window.g = window.g || {};
(function() {
    window.g = window.g || {};
    function e(e) {
        if (document.cookie.length > 0) {
            c_start = document.cookie.indexOf(e + "=");
            if (c_start != -1) {
                c_start = c_start + e.length + 1;
                c_end = document.cookie.indexOf(";", c_start);
                if (c_end == -1)
                    c_end = document.cookie.length;
                return decodeURIComponent(document.cookie.substring(c_start, c_end))
            }
        }
        return""
    }
    g.cityCode = function(t) {
        t = parseInt(t);
        if (t >= 0 && t <= 4) {
        } else {
            t = 3
        }
        var n = "";
        var i = e("atgregion") || "11011400|北京北京市东城区东城区|11010000|11000000|110114001";
        var a = i.split("|");
        switch (t) {
            case 0:
                n = a[1];
                break;
            case 1:
                n = a[3];
                break;
            case 2:
                n = a[2];
                break;
            case 3:
                n = a[0];
                break;
            case 4:
                n = a[4] == undefined ? a[0] + "1" : a[4];
                break
        }
        return n
    }
})();
(function() {
    var e = jQuery;
    window.g = window.g || {};
    function t(e) {
        if (e.substr(e.length - 1, 1) == "/") {
            return e.substr(0, e.length - 1)
        } else {
            return e
        }
    }
    var n = {w: t(staSite), item: t(staSite.replace("www", "item")), js: t(stageJsServer), css: t(stageCssServer), img: t(stageImageServer), login: t(staSite.replace("www", "login")), reg: t(staSite.replace("www", "reg")), desc: t(staSite.replace("www", "desc")), contextPath: contextPath, getParam: function(e) {
            var t = {};
            if (location.search.indexOf("?") != -1) {
                var n = location.search.substr(1);
                strs = n.split("&");
                for (var i = 0; i < strs.length; i++) {
                    if (strs[i].split("=").length !== 2) {
                        continue
                    }
                    t[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1])
                }
            }
            if (t[e] == undefined) {
                t[e] = ""
            }
            return t[e]
        }, g: t(dynSite)};
    g.url = n
})();
(function() {
    var e = jQuery;
    ajax = function() {
        if (typeof arguments[0] != "string") {
            return
        }
        var t = undefined;
        var n = {};
        var i = undefined;
        var a = {};
        if (arguments.length == 1) {
            t = arguments[0];
            n = {}
        } else if (arguments.length == 2) {
            if (typeof arguments[1] == "function") {
                t = arguments[0];
                i = arguments[1]
            } else {
                t = arguments[0];
                n = arguments[1]
            }
        } else if (arguments.length == 3 && typeof arguments[2] == "function") {
            t = arguments[0];
            n = arguments[1];
            i = arguments[2]
        } else if (arguments.length == 3 && typeof arguments[2] == "object") {
            t = arguments[0];
            n = arguments[1];
            a = arguments[2]
        } else if (arguments.length == 4) {
            t = arguments[0];
            n = arguments[1];
            a = arguments[2];
            i = arguments[3]
        }
        if (typeof a.site == "string" && a.site.indexOf("g") >= 0) {
            t = g.url.g + t
        } else if (typeof a.site == "string" && a.site.indexOf("w") >= 0) {
            t = g.url.w + t
        } else if (typeof a.site == "string" && a.site.indexOf("f") >= 0) {
            t = t
        } else if (n.site && n.site.indexOf("g") >= 0) {
            t = g.url.g + t
        } else if (n.site && n.site.indexOf("w") >= 0) {
            t = g.url.w + t
        } else if (n.site && n.site.indexOf("f") >= 0) {
            t = t
        } else if (n.site && n.site.indexOf("s") >= 0) {
            t = "http://ss" + cookieDomain + t
        } else {
            t = g.url.g + t
        }
        if (n.site) {
            delete n.site
        }
        var r = {type: "get", url: t, data: n, dataType: "jsonp", jsonpName: n.callback == undefined ? "cb_" + parseInt(Math.random() * 1e15) : n.callback, success: function(e) {
                i && i(e)
            }};
        if (n.callback) {
            delete n.callback
        }
        if (typeof a == "object") {
            e.extend(r, a)
        }
        return e.ajax(r)
    };
    window.g = window.g || {};
    g.ajax = ajax
})();
(function() {
    function e(e) {
        this._endfn = [];
        this._subs = [];
        this._init = [];
        this._endStatus = false;
        this.setAJAX = e
    }
    e.prototype = {publish: function() {
            var e = this;
            for (var t = 0; t < e._init.length; t++) {
                if (e._init[t]() == false) {
                    return
                }
            }
            this._endStatus = false;
            if (typeof this.setAJAX == "function") {
                this.setAJAX().done(function(t) {
                    for (var n = 0; n < e._subs.length; n++) {
                        e._subs[n](t)
                    }
                    e._endStatus = true;
                    for (var n = 0; n < e._endfn.length; n++) {
                        e._endfn[n](t)
                    }
                })
            } else {
                for (var t = 0; t < e._subs.length; t++) {
                    e._subs[t](data)
                }
                e._endStatus = true;
                for (var t = 0; t < e._endfn.length; t++) {
                    e._endfn[t](data)
                }
            }
        }, init: function(e) {
            e && this._init.push(e)
        }, addSub: function(e) {
            e && this._subs.push(e)
        }, end: function(e) {
            e && this._endfn.push(e)
        }, endStatus: function() {
            return this._endStatus
        }};
    window.g = window.g || {};
    g.Pubsub = e
})();
(function(e) {
    var t = jQuery;
    var n = g.url.g.indexOf(location.host) >= 0 ? "http://" + location.host + "/ec/homeus/glogin_callback.html" : "http://" + location.host + "/glogin_callback.html";
    var i = {loaded: false, login_url: function() {
            if (g.url.login.indexOf("atgsit") > 0 || g.url.login.indexOf("atguat") > 0 || g.url.login.indexOf("gomeprelive") > 0) {
                return g.url.login
            } else {
                return g.url.login.replace("http", "https")
            }
        }() + "/popLogin.no?callbackHost=" + n + "&orginURI=" + location.href, reg_url: function() {
            if (g.url.reg.indexOf("atgsit") > 0 || g.url.reg.indexOf("atguat") > 0 || g.url.reg.indexOf("gomeprelive") > 0) {
                return g.url.reg
            } else {
                return g.url.reg.replace("http", "https")
            }
        }() + "/register/index/pop.no?callbackHost=" + n + "&orginURI=" + location.href, verifyUserUrl: g.url.login + "/redirectResetPwd.no?loginType=1", loginbg: t('<div style="position:fixed;top:0;left:0; width:100%;height:100%;  background:#000;opacity:0.15;  filter:alpha(opacity=15); display:none;"></div>'), loginfrm: t('<iframe id="loginFrame" scrolling="no"  frameborder="0" style="z-index:2; width:462px;height:605px; position:fixed;   background-color:transparent; " allowTransparency="true"></iframe>'), zIndex: 1e4, show: function(e) {
            i.loginbg.show().css("zIndex", i.zIndex);
            i.loginfrm.remove();
            i.loginfrm = t('<iframe scrolling="no"  frameborder="0" style="z-index:2; width:462px;height:605px; position:fixed;   background-color:transparent; " allowTransparency="true"></iframe>');
            t("body").append(i.loginfrm);
            i.loginfrm.attr("src", i.src + "&orginURI=" + location.href + (e == undefined || e == "" ? "" : "&userName=" + e) + "&_t=" + parseInt(Math.random() * 1e12));
            i.loginfrm.show().css({left: (t(window).innerWidth() - i.loginfrm.width()) / 2, top: (t(window).height() - i.loginfrm.height()) / 2, zIndex: i.zIndex + 1})
        }, verifyUser_Show: function() {
            i.loginbg.show().css("zIndex", i.zIndex);
            i.loginfrm.show().css({left: (t(window).innerWidth() - i.loginfrm.width()) / 2, top: (t(window).height() - i.loginfrm.height()) / 2, zIndex: i.zIndex + 1}).attr("src", i.verifyUserUrl + "&callbackHost=" + n + "&orginURI=" + location.href + "&_t=" + parseInt(Math.random() * 1e12))
        }, login_open: function(e) {
            i.loginbg.show().css("zIndex", i.zIndex);
            i.loginfrm.remove();
            i.loginfrm = t('<iframe id="loginFrame" scrolling="no"  frameborder="0" style="z-index:2; width:462px;height:605px; position:fixed;   background-color:transparent; " allowTransparency="true"></iframe>');
            t("body").append(i.loginfrm);
            i.loginfrm.attr("src", i.login_url + (e == undefined || e == "" ? "" : "&userName=" + e) + "&_t=" + parseInt(Math.random() * 1e12));
            i.loginfrm.show().css({left: (t(window).innerWidth() - i.loginfrm.width()) / 2, top: (t(window).height() - i.loginfrm.height()) / 2, zIndex: i.zIndex + 1});
            var n = window.setInterval(function() {
                var e = document.getElementById("loginFrame");
                try {
                    if (e.src == "http://www.gome.com.cn/glogin_callback.html") {
                        var t = 1;
                        t = parseInt(t);
                        switch (t) {
                            case 0:
                                g.login.callback();
                                break;
                            case 1:
                                g.login.callback(true);
                                break;
                            case 2:
                                g.login.verifyUser();
                                break;
                            case 3:
                                g.login.login_open(getParam("userName"));
                                break;
                            case 4:
                                g.login.reg_open();
                                break;
                            case 10:
                                g.embedLogin.callback(true);
                                break;
                            case 11:
                                g.embedLogin.start_login();
                                break;
                            case 12:
                                g.embedLogin.start_reg();
                                break;
                            default:
                                g.login.callback();
                                break
                        }
                        clearInterval(n)
                    }
                } catch (i) {
                    clearInterval(n)
                }
            }, 1e3)
        }, reg_open: function() {
            i.loginbg.show().css("zIndex", i.zIndex);
            i.loginfrm.remove();
            i.loginfrm = t('<iframe scrolling="no"  frameborder="0" style="z-index:2; width:462px;height:605px; position:fixed;   background-color:transparent; " allowTransparency="true"></iframe>');
            t("body").append(i.loginfrm);
            i.loginfrm.attr("src", i.reg_url + "&_t=" + parseInt(Math.random() * 1e12));
            i.loginfrm.show().css({left: (t(window).innerWidth() - i.loginfrm.width()) / 2, top: (t(window).height() - i.loginfrm.height()) / 2, zIndex: i.zIndex + 1})
        }, close: function() {
            i.loginbg.hide();
            i.loginfrm.hide().removeAttr("src")
        }, callback: function() {
        }};
    login = function(e, n) {
        if (i.loaded == false) {
            i.loaded = true;
            t("body").append(i.loginbg)
        }
        if (login.running == true) {
            return
        }
        login.running = true;
        i.fn = null;
        t.ajax({type: "get", url: "http://member" + cookieDomain + "/gome/index/loginStyle", dataType: "jsonp", jsonpName: "loginStyle"}).done(function(t) {
            login.running = false;
            if (t.loginStatus >= 3) {
                e && e()
            } else {
                i.fn = e;
                "reg" == n ? i.reg_open() : i.login_open()
            }
        })
    };
    login.callback = function(e) {
        i.close();
        if (e) {
            if (window.signData) {
                signData.lazyCartEnd = false;
                signData.loginEnd = false;
                signData.gloginfn = i.fn;
                signData.init()
            } else {
                i.fn && i.fn()
            }
        }
    };
    login.close = function() {
    };
    login.verifyUser = function() {
        i.close();
        i.verifyUser_Show()
    };
    login.login_open = function(e) {
        i.close();
        i.login_open(e)
    };
    login.reg_open = function() {
        i.close();
        i.reg_open()
    };
    login.config = function(e) {
        i = t.extend(i, e)
    };
    e.login = login
})(g);
(function(e) {
    var t = jQuery;
    var n = g.url.g.indexOf(location.host) >= 0 ? "http://" + location.host + "/ec/homeus/glogin_callback.html" : "http://" + location.host + "/glogin_callback.html";
    var i = {start: function(e) {
            t.extend(i.config, e);
            if (!i.config.wrap) {
                return
            }
            i.config.frm.remove();
            i.config.frm = t('<iframe scrolling ="no" style="height: 315px; width: 294px;" frameborder="0"></iframe>');
            i.callback = e.callback;
            t(i.config.wrap).append(i.config.frm);
            i.config.frm.attr("src", i.config.src_login + "?callbackHost=" + n + (i.config.toSite ? "&toSite=" + i.config.toSite : ""))
        }, start_login: function() {
            i.config.frm.remove();
            i.config.frm = t('<iframe scrolling ="no" style="height: 315px; width: 294px;" frameborder="0"></iframe>');
            t(i.config.wrap).append(i.config.frm);
            i.config.frm.attr("src", i.config.src_login + "?callbackHost=" + n + (i.config.toSite ? "&toSite=" + i.config.toSite : ""))
        }, start_reg: function() {
            i.config.frm.remove();
            i.config.frm = t('<iframe scrolling ="no" style="height: 315px; width: 294px;" frameborder="0"></iframe>');
            t(i.config.wrap).append(i.config.frm);
            i.config.frm.attr("src", i.config.src_reg + "?callbackHost=" + n + (i.config.toSite ? "&toSite=" + i.config.toSite : ""))
        }, config: {callback: undefined, frm: t('<iframe scrolling ="no" style="height: 315px; width: 294px;" frameborder="0"></iframe>'), src_login: g.url.login + "/embedLogin.no", src_reg: g.url.reg + "/register/index/embed.no", toSite: undefined}, callback: function(e) {
            if (e) {
                i.config.frm.remove();
                i.config.callback && i.config.callback()
            }
        }};
    e.embedLogin = i
})(g);
(function(e) {
    var t = jQuery;
    var n = t('<div class="Dialog_bg"></div>');
    var i = false;
    function a(e, a) {
        if (!i) {
            i = true;
            t("body").append(n)
        }
        a = a || {};
        this.config = a;
        this.config.zIndex = a.zIndex || 1e4;
        this._bg_Dialog = n;
        this._dom = e;
        this._wrap = t('<div class="Dialog"></div>');
        this._wrap.append(e);
        t("body").append(this._wrap);
        if (a.closeBtn != false) {
            this._closeBtn = t('<a class="closeBtn" href="javascript:;">╳</a>');
            this._wrap.append(this._closeBtn);
            var r = this;
            this._closeBtn.click(function() {
                r.close()
            })
        }
        e.show()
    }
    a.prototype = {open: function(e) {
            if (e) {
                var n = e();
                if (n == false) {
                    return
                }
            }
            var i = this;
            var a = window.navigator.userAgent.indexOf("IE6") > 0;
            this._bg_Dialog.show().css({"z-index": this.config.zIndex - 1});
            this._wrap.show().css({top: t(window).height() / 2 - this._dom.height() / 2 + (a ? t(window).scrollTop() : 0), left: t(window).width() / 2 - this._dom.width() / 2 + (a ? t(window).scrollLeft() : 0), "z-index": i.config.zIndex})
        }, close: function(e) {
            if (e) {
                var t = e();
                if (t == false) {
                    return
                }
            }
            this._bg_Dialog.hide();
            if (this.config.isDestroy) {
                this._wrap.remove()
            } else {
                this._wrap.hide()
            }
        }};
    e.Dialog = a
})(g);
(function(e) {
    var t = jQuery;
    var n;
    var i;
    var a;
    var r;
    function o(e, s) {
        (function() {
            n = t('<div class="addCart-box">' + '<div class="addCart-loading">正在添加商品到购物车...</div>' + '<div class="addCart-state-success dn">' + '<span class="addCart-state-icon"></span>' + '<h5 class="addCart-state">添加成功</h5>' + '<p class="addCart-info">购物车共有<b class="totalQuantity highlight">5</b>件商品，商品总价：<b class="highlight totalAmount">¥3122.00</b></p>' + '<div class="addCart-btn">' + '<a class="addCart-gotoCart" href="' + g.url.g + '/ec/homeus/cart/cart.jsp">去购物车结算&nbsp;&gt;</a>' + '<a class="addCart-shopping">继续购物</a>' + "</div>" + "</div>" + '<dl class="addCart-bulkData">' + '<dt class="bulkData-title">购买了此商品的用户还购买了：</dt>' + "</dl>" + "</div>");
            t("body").append(n);
            i = new g.Dialog(n);
            n.find(".addCart-shopping").click(function() {
                i.close()
            });
            a = t('<div class="addCart-state-failed">' + '<span class="addCart-state-icon"></span>' + '<p>您购物车中的相同商品购买数量<span class="highlight">不能大于<b>20</b>件</span></p>' + '<p>请您&nbsp;<a href="' + g.url.g + "/ec/homeus/myaccount/customer/customer.jsp" + '" class="link"><b>点击此链接</b></a>&nbsp;联系客服购买！</p>' + "</div>");
            t("body").append(a);
            r = new g.Dialog(a)
        })();
        s = s || {showDialog: true};
        t(".addCart-loading").show();
        t(".addCart-state-success").hide();
        t.ajax({type: "get", url: o.config.url_addCart, data: {method: e.method || "homeus.addNormalItemToOrder", params: JSON.stringify(t.extend(e, o.config.data))}, dataType: "jsonp"}).done(function(e) {
            s.callback && s.callback(e)
        }).done(function(e) {
            if (e.result && e.result.cart) {
                n.find(".addCart-loading").hide();
                n.find(".addCart-state-success").show();
                n.find(".totalQuantity").html(e.result.cart.cartSummary.totalQuantity);
                n.find(".totalAmount").html("¥" + e.result.cart.cartSummary.totalAmount)
            }
        }).done(function(e) {
            if (e.result && e.result.cart) {
                return
            }
            var t = e;
            if (t.error && t.error.data) {
                var n = t.error.data, o = n.code, s = "", l = "件";
                var c = false;
                switch (o) {
                    case"gomeSKU":
                        s = "您购物车中的商品种类";
                        l = "种";
                        break;
                    case"bookSKU":
                        s = "您购物车中的图书种类";
                        l = "种";
                        break;
                    case"bbcSKU":
                        s = "您购物车中的店铺商品种类";
                        l = "种";
                        break;
                    case"gomeQuantity":
                        s = "您购物车中的相同商品购买数量";
                        break;
                    case"bookQuantity":
                        s = "您购物车中的相同图书购买数量";
                        break;
                    case"bbcQuantity":
                        s = "您购物车中的相同店铺商品购买数量";
                        break;
                    case"bbcQuantityForLimitBuy":
                        s = t.error.data.message;
                        break;
                    default:
                        s = "您购物车中的相同商品购买数量";
                        c = true
                }
                if (window.useriderror == true) {
                    a.html("该商品暂无法购买，请您联系客服解决：4008-708-708")
                } else if (n.code == "bbcQuantityForLimitBuy") {
                    _htm = '<div class="errorTxt">' + s + "</div>";
                    _this.dialog({inner: "#dialogEr", cssname: "dialogBox Er", errIco: "warn", errMsg: _htm})
                } else if (l == "件") {
                    a = '<div class="addCart-state-failed">' + '<span class="addCart-state-icon"></span>' + "<p>" + s + '<span class="highlight">不能大于<b>' + n.quantityMax + "</b>件</span></p>" + '<p>请您&nbsp;<a href="' + g.url.g + "/ec/homeus/myaccount/customer/customer.jsp" + '" class="link"><b>点击此链接</b></a>&nbsp;联系客服购买！</p>' + "</div>"
                } else if (l == "种") {
                    a = '<div class="addCart-state-failed">' + '<span class="addCart-state-icon"></span>' + "<p>" + s + "已达上限(" + n.quantityMax + l + ")！</p>" + "</div>"
                }
            } else {
                a.html("添加异常！请重试！")
            }
            i.close();
            r.open()
        });
        i.open();
        setTimeout(function() {
            g.ajax("http://bigd.gome.com.cn/gome/dataOrderAssociate", {pid: e.productId, area: g.cityCode(), size: 4, imagesize: 80, callbackparam: "dataOrderAssociateService", callback: "dataOrderAssociateService", site: "f"}).done(function(e) {
                n.find(".addCart-bulkData").html("").html('<dt class="bulkData-title">购买了此商品的用户还购买了：</dt>' + "");
                var t = "";
                for (var i = 0; i < e.productList.length; i++) {
                    t += '<dd class="bulkData-item">' + '<a href="' + e.productList[i].detailHref + ' title="' + e.productList[i].dispName + '" class="bulkData-pic" target="_blank"><img width="80" height="80" src="' + e.productList[i].imgUrl + '" alt="' + e.productList[i].dispName + '"></a>' + '<a href="' + e.productList[i].detailHref + ' title="' + e.productList[i].dispName + '" class="bulkData-name" target="_blank">' + e.productList[i].dispName + "</a>";
                    "</dd>"
                }
                n.find(".addCart-bulkData").css({visibility: "visible"}).html("").html('<dt class="bulkData-title">购买了此商品的用户还购买了：</dt>' + t)
            })
        })
    }
    o.config = {url_addCart: g.url.g + "/ec/homeus/support/add.jsp", url_cart: "", data: {addItemCount: 1, quantity: 1, method: "homeus.addNormalItemToOrder"}};
    e.addCart = o
})(g);
(function(e) {
    e.fn.autopoint = function(t) {
        defaults = {url: t.url, environment: t.environment, targetType: t.targetType, contentLabels: t.contentLabels, language: t.language, keyLeft: 37, keyUp: 38, keyRight: 39, keyDown: 40, keyEnter: 13, listHoverCSS: "hover", topoffset: t.topoffset || 10};
        var t = e.extend(defaults, t);
        var i = e("#searchTips");
        var s = e("#searchTipsList");
        var n = false;
        i.hover(function() {
            n = true
        }, function() {
            n = false
        });
        var a = e.cookie("__clickidc"), o = ["search", "delete", "clear"], r = "", l = "";
        var h = function() {
            this.capacity = 3;
            this.list = new Array;
            this.push = function(e, t) {
                var i = {key: e, value: t};
                if (i == null)
                    return;
                if (this.list.length >= this.capacity) {
                    this.list.removeCache(0)
                }
                this.list.push(i)
            };
            this.remove = function(e) {
                if (this.list == null)
                    return;
                this.list.removeCache(0)
            };
            this.clear = function() {
                this.list = new Array
            };
            this.get = function(e) {
                if (e == null)
                    return;
                for (var t = 0; t < this.list.length; t++) {
                    var i = this.list[t];
                    if (e == i.key) {
                        return i
                    }
                }
            }
        };
        Array.prototype.removeCache = function(e) {
            if (isNaN(e) || e > this.length) {
                return false
            }
            for (var t = 0, i = 0; t < this.length; t++) {
                if (this[t] != this[e]) {
                    this[i++] = this[t]
                }
            }
            this.length -= 1
        };
        var c = new h;
        return this.each(function() {
            var r = e(this);
            var h = -1;
            var f = false;
            e(this).bind("keydown", function(n) {
                if (i.css("display") != "none") {
                    var a = s.find("." + t.listHoverCSS);
                    if (n.keyCode == t.keyDown) {
                        var o = null;
                        h++;
                        if (h == s.find("li").length) {
                            h = 0
                        }
                        o = s.find("li").eq(h);
                        if (o != null) {
                            unHoverAll();
                            o.mouseover();
                            f = false;
                            e(this).val(getPointWord(o))
                        }
                        return false
                    } else if (n.keyCode == t.keyUp) {
                        var r = null;
                        if (h != -1) {
                            h--
                        }
                        if (h == -1) {
                            h = s.find("li").length - 1
                        }
                        r = s.find("li").eq(h);
                        if (r != null) {
                            unHoverAll();
                            r.mouseover();
                            f = false;
                            e(this).val(getPointWord(r))
                        }
                        return false
                    } else if (n.keyCode == t.keyEnter) {
                        var l = s.find("li").eq(h);
                        var c = getPointWord(l);
                        if (l.hasClass("search-item")) {
                            var u = l.attr("category");
                            if (h == -1) {
                                var d = "http://search" + cookieDomain + "/search?question=" + encodeURI(c)
                            } else {
                                var d = "http://search" + cookieDomain + "/search?question=" + encodeURI(c) + "&catId=" + u
                            }
                            window.location.href = d;
                            return false
                        } else {
                            if (e(".search-input-bot").attr("autoPoint") == "point") {
                                doSearchbot()
                            } else {
                                doSearch()
                            }
                        }
                        return false
                    }
                }
                e(this).attr("alt", e(this).val());
                f = true
            }).hover(function() {
                n = true
            }, function() {
                n = false
            });
            var u = function(t) {
                if (!f) {
                    return
                }
                var n = e(this).val();
                if (e(this).val() == e(this).attr("alt")) {
                    return
                } else {
                    if (e("#his_title").css("display") == "block") {
                        e("#his_title").hide(0);
                        s.empty();
                        i.hide(0)
                    } else {
                    }
                    setTimeout(function() {
                        e("#his_title").hide(0);
                        if (d) {
                            clearTimeout(d)
                        }
                        d = setTimeout(function() {
                            getData(r, n)
                        }, 200)
                    }, 1e3);
                    e("#his_title").hide(0)
                }
                if (e(this).val() == "") {
                    setTimeout(function() {
                        signData.login({}, function(t) {
                            if (window.loginData.loginId) {
                                l = window.loginData.loginId
                            }
                            if (!t.isTransient && t.isTransient != "true") {
                                s.empty();
                                getDataHis(r, 0)
                            } else {
                                s.empty();
                                e("#his_title").hide(0);
                                i.hide(0);
                                return
                            }
                        })
                    }, 1e3)
                }
            };
            this.oninput = u;
            this.onpropertychange = u;
            var d = null;
            e("body").mouseover(function() {
                if (d) {
                    clearTimeout(d)
                }
                d = setTimeout(function() {
                    if (n && i.find("." + t.listHoverCSS) != 0) {
                        return
                    }
                    s.empty();
                    i.hide()
                }, 150)
            });
            handleResponse = function(t, s) {
                if (s == null || s.length == 0) {
                    i.hide();
                    e("#his_title").hide(0);
                    return
                }
                render(t, s);
                e("#his_title").hide(0);
                i.show()
            };
            handleResponseHis = function(e, t) {
                if (t == null || t.length == 0) {
                    i.hide();
                    return
                }
                renderHis(e, t);
                i.show()
            };
            render = function(e, t) {
                s.empty();
                var i = "";
                for (var n = 0; n < t.length; n++) {
                    var a = t[n];
                    if (a.length >= 4) {
                        i += '<li class="search-item" category="' + a[3].cat[1] + '" keyword="' + a[0] + '">' + '<span class="fs" style="float:left;">在' + "<b>" + a[3].cat[3] + "</b><i>&gt;</i>" + '<a class="akeyword" href="javascript:txtCode();">' + a[3].cat[0] + '</a>分类中搜索</span><span class="fr color-b">约' + a[3].cat[2] + "条</span></li>"
                    } else {
                        i += '<li><a class="akeyword" href="javascript:txtCode();">' + '<span class="fl">' + a[0] + '</span><span class="fr color-b">约' + a[1] + "条</span></a></li>"
                    }
                }
                jebind(e, i)
            };
            renderHis = function(t, i) {
                s.empty();
                var n = "";
                var a = "";
                for (var o = 0, r = i.length; o < r; o++) {
                    if (r >= 1) {
                        a += '<li><a class="akeyword" href="#">' + '<span class="fl">' + i[o].search + '</span><span id="his_del" class="fr color-b" style="display:none">删除</span></a></li>'
                    }
                }
                e("#searchTips").find("ul").append(a);
                jebindHis(t, a)
            };
            jebind = function(n, a) {
                s.append(a);
                s.find("li.search-item:last").css("border-bottom", "1px solid #EEEEEE");
                s.find("li").each(function(a) {
                    e(this).attr("index", a);
                    e(this).unbind("mouseover").mouseover(function() {
                        unHoverAll();
                        e(this).addClass(t.listHoverCSS);
                        e(this).find("a:first").addClass(t.listHoverCSS);
                        h = e(this).attr("index")
                    }).unbind("click").click(function() {
                        var t = getPointWord(e(this));
                        n.val(t);
                        s.empty();
                        i.hide();
                        n.focus();
                        h = -1;
                        if (e(this).hasClass("search-item")) {
                            var a = e(this).attr("category");
                            var o = "http://search" + cookieDomain + "/search?question=" + encodeURI(t) + "&catId=" + a;
                            window.location.href = o;
                            return false
                        } else {
                            if (e(".search-input-bot").attr("autoPoint") == "point") {
                                doSearchbot()
                            } else {
                                doSearch()
                            }
                        }
                    })
                })
            };
            jebindHis = function(n, a) {
                e("#hisClear").click(function() {
                    getDataHis(r, 2)
                });
                s.find("li").each(function(a) {
                    e(this).find("#his_del").click(function(t) {
                        t.stopPropagation();
                        var i = e(this).siblings().text();
                        getDataHis(r, 1, i)
                    });
                    e(this).unbind("mouseover").mouseover(function() {
                        unHoverAll();
                        e(this).find("#his_del").show();
                        e(this).siblings().find("#his_del").hide();
                        e(this).addClass(t.listHoverCSS);
                        e(this).find("a:first").addClass(t.listHoverCSS);
                        h = e(this).index()
                    }).unbind("click").click(function() {
                        var t = getPointWord(e(this));
                        n.val(t);
                        s.empty();
                        i.hide();
                        n.focus();
                        h = -1;
                        if (e(this).hasClass("search-item")) {
                            var a = e(this).attr("category");
                            var o = "http://search" + cookieDomain + "/search?question=" + encodeURI(t) + "&catId=" + a;
                            window.location.href = o;
                            return false
                        } else {
                            if (e(".search-input-bot").attr("autoPoint") == "point") {
                                doSearchbot()
                            } else {
                                doSearch()
                            }
                        }
                    })
                })
            };
            unHoverAll = function() {
                s.find("li").each(function(i) {
                    e(this).removeClass(t.listHoverCSS);
                    e(this).find("a:first").removeClass(t.listHoverCSS)
                })
            };
            getPointWord = function(e) {
                return e.attr("keyword") ? e.attr("keyword") : e.find("span:first").text()
            };
            getData = function(i, n) {
                n = n.replace(/[()'";,{}~!@#$%^&*(){}?\|<>.]/g, "");
                var a = document.location, o = /\/category\/(.*)?\.html.*$/gi, r = [], l, h = "";
                while (r = o.exec(a)) {
                    l = r[1]
                }
                if (l)
                    h = "&category=" + l;
                var f = t.url + "&module=searchSuggest" + "&query=" + encodeURI(n) + "&jp=true" + h;
                if (c.get(n)) {
                    var u = c.get(n).value;
                    handleResponse(i, u)
                } else {
                    e.ajax({type: "get", url: f, dataType: "jsonp", jsonpName: "suggest", success: function(t) {
                            e("#his_title").hide(0);
                            s.empty();
                            handleResponse(i, t);
                            c.push(n, t)
                        }})
                }
            };
            getDataHis = function(t, n, r) {
                var h = r && r != undefined ? "&product=" + r : "";
                e.ajax({type: "get", url: "http://bigd.gome.com.cn/gome/search?cid=" + a + "&uid=" + l + "&type=" + o[n] + h, cache: false, dataType: "jsonp", jsonpName: "search", success: function(a) {
                        if (n == 1) {
                            if (a.status == "0") {
                                getDataHis(t, 0)
                            }
                        } else if (n == 2) {
                            if (a.status == "0") {
                                s.empty();
                                i.hide()
                            }
                        } else {
                            a = a.lst;
                            if (a && a.length) {
                                e("#his_title").show();
                                handleResponseHis(t, a)
                            } else {
                                e("#his_title").hide();
                                i.hide()
                            }
                        }
                    }})
            };
            e("#searchInput").focus(function() {
                if (e("#searchInput").val() == "") {
                    setTimeout(function() {
                        signData.login({}, function(e) {
                            if (window.loginData.loginId) {
                                l = window.loginData.loginId
                            }
                            if (!e.isTransient && e.isTransient != "true") {
                                i.hide();
                                getDataHis(r, 0)
                            } else {
                            }
                        })
                    }, 1e3)
                } else {
                    e("#his_title").hide();
                    s.empty();
                    i.hide();
                    var t = e(this).val();
                    getData(r, t)
                }
            })
        })
    }
})(jQuery);
var gomeLib = gomeLib || {};
gomeLib.ajax = function(a, e) {
    var s = a.type || "get", i = a.url, o = a.cache || false, t = a.dataType || "jsonp", n = a.jsonpName || "", p = a.stringify || false, r = a.d || "";
    if (p) {
        var c = {};
        c.method = r.method;
        c.id = "12";
        c.params = JSON.parse(r.params);
        c = {json: JSON.stringify(c)};
        r = c
    }
    $.ajax({type: s, url: i, cache: o, dataType: t, jsonpName: n, jsonpCallback: n, data: r, success: function(a) {
            if (a) {
                e(a)
            }
        }})
};
var template = function(e, n) {
    return template[typeof n === "object" ? "render" : "compile"].apply(template, arguments)
};
(function(e, n) {
    "use strict";
    e.version = "2.0.1";
    e.openTag = "<%";
    e.closeTag = "%>";
    e.isEscape = true;
    e.isCompress = false;
    e.parser = null;
    e.render = function(e, n) {
        var r = t(e);
        if (r === undefined) {
            return i({id: e, name: "Render Error", message: "No Template"})
        }
        return r(n)
    };
    e.compile = function(n, t) {
        var o = arguments;
        var u = o[2];
        var c = "anonymous";
        if (typeof t !== "string") {
            u = o[1];
            t = o[0];
            n = c
        }
        try {
            var s = a(t, u)
        } catch (l) {
            l.id = n || t;
            l.name = "Syntax Error";
            return i(l)
        }
        function f(r) {
            try {
                return new s(r) + ""
            } catch (a) {
                if (!u) {
                    return e.compile(n, t, true)(r)
                }
                a.id = n || t;
                a.name = "Render Error";
                a.source = t;
                return i(a)
            }
        }
        f.prototype = s.prototype;
        f.toString = function() {
            return s.toString()
        };
        if (n !== c) {
            r[n] = f
        }
        return f
    };
    e.helper = function(n, r) {
        e.prototype[n] = r
    };
    e.onerror = function(e) {
        var r = "[template]:\n" + e.id + "\n\n[name]:\n" + e.name;
        if (e.message) {
            r += "\n\n[message]:\n" + e.message
        }
        if (e.line) {
            r += "\n\n[line]:\n" + e.line;
            r += "\n\n[source]:\n" + e.source.split(/\n/)[e.line - 1].replace(/^[\s\t]+/, "")
        }
        if (e.temp) {
            r += "\n\n[temp]:\n" + e.temp
        }
        if (n.console) {
            console.error(r)
        }
    };
    var r = {};
    var t = function(t) {
        var i = r[t];
        if (i === undefined && "document"in n) {
            var a = document.getElementById(t);
            if (a) {
                var o = a.value || a.innerHTML;
                return e.compile(t, o.replace(/^\s*|\s*$/g, ""))
            }
        } else if (r.hasOwnProperty(t)) {
            return i
        }
    };
    var i = function(n) {
        e.onerror(n);
        function r() {
            return r + ""
        }
        r.toString = function() {
            return"{Template Error}"
        };
        return r
    };
    var a = function() {
        e.prototype = {$render: e.render, $escape: function(e) {
                return typeof e === "string" ? e.replace(/&(?![\w#]+;)|[<>"']/g, function(e) {
                    return{"<": "&#60;", ">": "&#62;", '"': "&#34;", "'": "&#39;", "&": "&#38;"}[e]
                }) : e
            }, $string: function(e) {
                if (typeof e === "string" || typeof e === "number") {
                    return e
                } else if (typeof e === "function") {
                    return e()
                } else {
                    return""
                }
            }};
        var n = Array.prototype.forEach || function(e, n) {
            var r = this.length >>> 0;
            for (var t = 0; t < r; t++) {
                if (t in this) {
                    e.call(n, this[t], t, this)
                }
            }
        };
        var r = function(e, r) {
            n.call(e, r)
        };
        var t = "break,case,catch,continue,debugger,default,delete,do,else,false" + ",finally,for,function,if,in,instanceof,new,null,return,switch,this" + ",throw,true,try,typeof,var,void,while,with" + ",abstract,boolean,byte,char,class,const,double,enum,export,extends" + ",final,float,goto,implements,import,int,interface,long,native" + ",package,private,protected,public,short,static,super,synchronized" + ",throws,transient,volatile" + ",arguments,let,yield" + ",undefined";
        var i = /\/\*(?:.|\n)*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|'[^']*'|"[^"]*"|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g;
        var a = /[^\w$]+/g;
        var o = new RegExp(["\\b" + t.replace(/,/g, "\\b|\\b") + "\\b"].join("|"), "g");
        var u = /\b\d[^,]*/g;
        var c = /^,+|,+$/g;
        var s = function(e) {
            e = e.replace(i, "").replace(a, ",").replace(o, "").replace(u, "").replace(c, "");
            e = e ? e.split(/,+/) : [];
            return e
        };
        return function(n, t) {
            var i = e.openTag;
            var a = e.closeTag;
            var o = e.parser;
            var u = n;
            var c = "";
            var l = 1;
            var f = {$data: true, $helpers: true, $out: true, $line: true};
            var p = e.prototype;
            var d = {};
            var v = "var $helpers=this," + (t ? "$line=0," : "");
            var g = "".trim;
            var $ = g ? ["$out='';", "$out+=", ";", "$out"] : ["$out=[];", "$out.push(", ");", "$out.join('')"];
            var m = g ? "if(content!==undefined){$out+=content;return content}" : "$out.push(content);";
            var h = "function(content){" + m + "}";
            var y = "function(id,data){" + "if(data===undefined){data=$data}" + "var content=$helpers.$render(id,data);" + m + "}";
            r(u.split(i), function(e, n) {
                e = e.split(a);
                var r = e[0];
                var t = e[1];
                if (e.length === 1) {
                    c += E(r)
                } else {
                    c += x(r);
                    if (t) {
                        c += E(t)
                    }
                }
            });
            u = c;
            if (t) {
                u = "try{" + u + "}catch(e){" + "e.line=$line;" + "throw e" + "}"
            }
            u = "'use strict';" + v + $[0] + u + "return new String(" + $[3] + ")";
            try {
                var w = new Function("$data", u);
                w.prototype = d;
                return w
            } catch (b) {
                b.temp = "function anonymous($data) {" + u + "}";
                throw b
            }
            function E(n) {
                l += n.split(/\n/).length - 1;
                if (e.isCompress) {
                    n = n.replace(/[\n\r\t\s]+/g, " ")
                }
                n = n.replace(/('|\\)/g, "\\$1").replace(/\r/g, "\\r").replace(/\n/g, "\\n");
                n = $[1] + "'" + n + "'" + $[2];
                return n + "\n"
            }
            function x(n) {
                var r = l;
                if (o) {
                    n = o(n)
                } else if (t) {
                    n = n.replace(/\n/g, function() {
                        l++;
                        return"$line=" + l + ";"
                    })
                }
                if (n.indexOf("=") === 0) {
                    var i = n.indexOf("==") !== 0;
                    n = n.replace(/^=*|[\s;]*$/g, "");
                    if (i && e.isEscape) {
                        var a = n.replace(/\s*\([^\)]+\)/, "");
                        if (!p.hasOwnProperty(a) && !/^(include|print)$/.test(a)) {
                            n = "$escape($string(" + n + "))"
                        }
                    } else {
                        n = "$string(" + n + ")"
                    }
                    n = $[1] + n + $[2]
                }
                if (t) {
                    n = "$line=" + r + ";" + n
                }
                O(n);
                return n + "\n"
            }
            function O(e) {
                e = s(e);
                r(e, function(e) {
                    if (!f.hasOwnProperty(e)) {
                        T(e);
                        f[e] = true
                    }
                })
            }
            function T(e) {
                var n;
                if (e === "print") {
                    n = h
                } else if (e === "include") {
                    d["$render"] = p["$render"];
                    n = y
                } else {
                    n = "$data." + e;
                    if (p.hasOwnProperty(e)) {
                        d[e] = p[e];
                        if (e.indexOf("$") === 0) {
                            n = "$helpers." + e
                        } else {
                            n = n + "===undefined?$helpers." + e + ":" + n
                        }
                    }
                }
                v += e + "=" + n + ","
            }}
    }()
})(template, this);
if (typeof define === "function") {
    define(function(e, n, r) {
        r.exports = template
    })
}
var tempnav = '<div class="category">	<dl>		<%		for(var i=0;i<catlog.length;i++){			var cats = catlog[i].cats;			var subc = catlog[i].subCates;		%>		<dt>		<% if(cats.ctype){ %>				<a rel="nofollow" href="<%= cats.href %>" title="<%= cats.title %>" target="_blank"><%= cats.title %></a>		<% }else{ %>				<%= cats.title %>		<% } %>		</dt>		<% 			var child = "";			if(cats.csize-1 == i){				child = "class=\'childfslast\'";			}		%>		<dd <%= child %> >			<% for(var j=0; j<subc.length; j++){ 				var sbc = subc[j];				var cls = "";				if(sbc.cls!=""){cls=sbc.cls;}				if(sbc.tv){			%>				<a href="<%= sbc.href %>" title="<%= sbc.title %>" target="_blank" class="<%= sbc.cls %> cdj-a"><%= sbc.title %><img src="<%= sbc.img %>" class="cdj-img" /></a>			<%				}else{			%>				<a href="<%= sbc.href %>" title="<%= sbc.title %>" target="_blank" class="<%= sbc.cls %> <%if (sbc.mark=="hot" || sbc.mark=="Hot" || sbc.mark=="HOT") {%>subcategory-hot<%}%>"><%= sbc.title %></a>			<%				}			}			%>		</dd>		<% } %>	</dl></div><% if(brand.btype){	var bcat = brand.bcat;%>	<div class="relatedads">		<h4>推荐品牌</h4>		<div class="brand clearfix">			<%			var _k = bcat.length;			if(_k>15){_k=15;}			for(var j=0;j<_k;j++){				var bct = bcat[j];			%>				<a rel="nofollow" title="<%= bct.title %>" href="<%= bct.href %>" target="_blank"><%= bct.title %></a>			<% } %>		</div>	</div>	<% 	if(brand.bimg.href!=undefined){ 		var bmg = brand.bimg;	%>	<a rel="nofollow" class="cxpic" href="<%= bmg.href %>" title="<%= bmg.alt %>" target="_blank"><img src="<%= bmg.src %>" alt="<%= bmg.alt %>"/></a><%	}}%><a class="closegsidenav" href="javascript:;"></a>';
(function($) {
    $.fn.ajaxSubmit = function(options) {
        if (typeof options == "function")
            options = {success: options};
        options = $.extend({url: this.attr("action") || window.location, type: this.attr("method") || "GET"}, options || {});
        var a = this.formToArray(options.semantic);
        if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false)
            return this;
        var veto = {};
        $.event.trigger("form.submit.validate", [a, this, options, veto]);
        if (veto.veto)
            return this;
        var q = $.param(a);
        if (options.type.toUpperCase() == "GET") {
            options.url += (options.url.indexOf("?") >= 0 ? "&" : "?") + q;
            options.data = null
        } else
            options.data = q;
        var $form = this, callbacks = [];
        if (options.resetForm)
            callbacks.push(function() {
                $form.resetForm()
            });
        if (options.clearForm)
            callbacks.push(function() {
                $form.clearForm()
            });
        if (!options.dataType && options.target) {
            var oldSuccess = options.success;
            callbacks.push(function(e) {
                $(options.target).attr("innerHTML", e).evalScripts().each(oldSuccess, arguments)
            })
        } else if (options.success)
            callbacks.push(options.success);
        options.success = function(e, t) {
            for (var o = 0, n = callbacks.length; o < n; o++)
                callbacks[o](e, t, $form)
        };
        var files = $("input:file", this).fieldValue();
        var found = false;
        for (var j = 0; j < files.length; j++)
            if (files[j])
                found = true;
        if (options.iframe || found)
            fileUpload();
        else
            $.ajax(options);
        $.event.trigger("form.submit.notify", [this, options]);
        return this;
        function fileUpload() {
            var form = $form[0];
            var opts = $.extend({}, $.ajaxSettings, options);
            var id = "jqFormIO" + $.fn.ajaxSubmit.counter++;
            var $io = $('<iframe id="' + id + '" name="' + id + '" />');
            var io = $io[0];
            var op8 = $.browser.opera && window.opera.version() < 9;
            if ($.browser.msie || op8)
                io.src = 'javascript:false;document.write("");';
            $io.css({position: "absolute", top: "-1000px", left: "-1000px"});
            var xhr = {responseText: null, responseXML: null, status: 0, statusText: "n/a", getAllResponseHeaders: function() {
                }, getResponseHeader: function() {
                }, setRequestHeader: function() {
                }};
            var g = opts.global;
            if (g && !$.active++)
                $.event.trigger("ajaxStart");
            if (g)
                $.event.trigger("ajaxSend", [xhr, opts]);
            var cbInvoked = 0;
            var timedOut = 0;
            setTimeout(function() {
                $io.appendTo("body");
                io.attachEvent ? io.attachEvent("onload", cb) : io.addEventListener("load", cb, false);
                var e = form.encoding ? "encoding" : "enctype";
                var t = $form.attr("target");
                $form.attr({target: id, method: "POST", encAttr: "multipart/form-data", action: opts.url});
                if (opts.timeout)
                    setTimeout(function() {
                        timedOut = true;
                        cb()
                    }, opts.timeout);
                form.submit();
                $form.attr("target", t)
            }, 10);
            function cb() {
                if (cbInvoked++)
                    return;
                io.detachEvent ? io.detachEvent("onload", cb) : io.removeEventListener("load", cb, false);
                var ok = true;
                try {
                    if (timedOut)
                        throw"timeout";
                    var data, doc;
                    doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
                    xhr.responseText = doc.body ? doc.body.innerHTML : null;
                    xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
                    if (opts.dataType == "json" || opts.dataType == "script") {
                        var ta = doc.getElementsByTagName("textarea")[0];
                        data = ta ? ta.value : xhr.responseText;
                        if (opts.dataType == "json")
                            eval("data = " + data);
                        else
                            $.globalEval(data)
                    } else if (opts.dataType == "xml") {
                        data = xhr.responseXML;
                        if (!data && xhr.responseText != null)
                            data = toXml(xhr.responseText)
                    } else {
                        data = xhr.responseText
                    }
                } catch (e) {
                    ok = false;
                    $.handleError(opts, xhr, "error", e)
                }
                if (ok) {
                    opts.success(data, "success");
                    if (g)
                        $.event.trigger("ajaxSuccess", [xhr, opts])
                }
                if (g)
                    $.event.trigger("ajaxComplete", [xhr, opts]);
                if (g && !--$.active)
                    $.event.trigger("ajaxStop");
                if (opts.complete)
                    opts.complete(xhr, ok ? "success" : "error");
                setTimeout(function() {
                    $io.remove();
                    xhr.responseXML = null
                }, 100)
            }
            function toXml(e, t) {
                if (window.ActiveXObject) {
                    t = new ActiveXObject("Microsoft.XMLDOM");
                    t.async = "false";
                    t.loadXML(e)
                } else
                    t = (new DOMParser).parseFromString(e, "text/xml");
                return t && t.documentElement && t.documentElement.tagName != "parsererror" ? t : null
            }}
    }
    ;
    $.fn.ajaxSubmit.counter = 0;
    $.fn.ajaxForm = function(e) {
        return this.ajaxFormUnbind().submit(submitHandler).each(function() {
            this.formPluginId = $.fn.ajaxForm.counter++;
            $.fn.ajaxForm.optionHash[this.formPluginId] = e;
            $(":submit,input:image", this).click(clickHandler)
        })
    };
    $.fn.ajaxForm.counter = 1;
    $.fn.ajaxForm.optionHash = {};
    function clickHandler(e) {
        var t = this.form;
        t.clk = this;
        if (this.type == "image") {
            if (e.offsetX != undefined) {
                t.clk_x = e.offsetX;
                t.clk_y = e.offsetY
            } else if (typeof $.fn.offset == "function") {
                var o = $(this).offset();
                t.clk_x = e.pageX - o.left;
                t.clk_y = e.pageY - o.top
            } else {
                t.clk_x = e.pageX - this.offsetLeft;
                t.clk_y = e.pageY - this.offsetTop
            }
        }
        setTimeout(function() {
            t.clk = t.clk_x = t.clk_y = null
        }, 10)
    }
    function submitHandler() {
        var e = this.formPluginId;
        var t = $.fn.ajaxForm.optionHash[e];
        $(this).ajaxSubmit(t);
        return false
    }
    $.fn.ajaxFormUnbind = function() {
        this.unbind("submit", submitHandler);
        return this.each(function() {
            $(":submit,input:image", this).unbind("click", clickHandler)
        })
    };
    $.fn.formToArray = function(e) {
        var t = [];
        if (this.length == 0)
            return t;
        var o = this[0];
        var n = e ? o.getElementsByTagName("*") : o.elements;
        if (!n)
            return t;
        for (var a = 0, r = n.length; a < r; a++) {
            var i = n[a];
            var s = i.name;
            if (!s)
                continue;
            if (e && o.clk && i.type == "image") {
                if (!i.disabled && o.clk == i)
                    t.push({name: s + ".x", value: o.clk_x}, {name: s + ".y", value: o.clk_y});
                continue
            }
            var c = $.fieldValue(i, true);
            if (c && c.constructor == Array) {
                for (var f = 0, l = c.length; f < l; f++)
                    t.push({name: s, value: c[f]})
            } else if (c !== null && typeof c != "undefined")
                t.push({name: s, value: c})
        }
        if (!e && o.clk) {
            var u = o.getElementsByTagName("input");
            for (var a = 0, r = u.length; a < r; a++) {
                var p = u[a];
                var s = p.name;
                if (s && !p.disabled && p.type == "image" && o.clk == p)
                    t.push({name: s + ".x", value: o.clk_x}, {name: s + ".y", value: o.clk_y})
            }
        }
        return t
    };
    $.fn.formSerialize = function(e) {
        return $.param(this.formToArray(e))
    };
    $.fn.fieldSerialize = function(e) {
        var t = [];
        this.each(function() {
            var o = this.name;
            if (!o)
                return;
            var n = $.fieldValue(this, e);
            if (n && n.constructor == Array) {
                for (var a = 0, r = n.length; a < r; a++)
                    t.push({name: o, value: n[a]})
            } else if (n !== null && typeof n != "undefined")
                t.push({name: this.name, value: n})
        });
        return $.param(t)
    };
    $.fn.fieldValue = function(e) {
        for (var t = [], o = 0, n = this.length; o < n; o++) {
            var a = this[o];
            var r = $.fieldValue(a, e);
            if (r === null || typeof r == "undefined" || r.constructor == Array && !r.length)
                continue;
            r.constructor == Array ? $.merge(t, r) : t.push(r)
        }
        return t
    };
    $.fieldValue = function(e, t) {
        var o = e.name, n = e.type, a = e.tagName.toLowerCase();
        if (typeof t == "undefined")
            t = true;
        if (t && (!o || e.disabled || n == "reset" || (n == "checkbox" || n == "radio") && !e.checked || a == "select" && e.selectedIndex == -1))
            return null;
        if (a == "select") {
            var r = e.selectedIndex;
            if (r < 0)
                return null;
            var i = [], s = e.options;
            var c = n == "select-one";
            var f = c ? r + 1 : s.length;
            for (var l = c ? r : 0; l < f; l++) {
                var u = s[l];
                if (u.selected) {
                    var p = $.browser.msie && !u.attributes["value"].specified ? u.text : u.value;
                    if (c)
                        return p;
                    i.push(p)
                }
            }
            return i
        }
        return e.value
    };
    $.fn.clearForm = function() {
        return this.each(function() {
            $("input,select,textarea", this).clearFields()
        })
    };
    $.fn.clearFields = $.fn.clearInputs = function() {
        return this.each(function() {
            var e = this.type, t = this.tagName.toLowerCase();
            if (e == "text" || e == "password" || t == "textarea")
                this.value = "";
            else if (e == "checkbox" || e == "radio")
                this.checked = false;
            else if (t == "select")
                this.selectedIndex = -1
        })
    };
    $.fn.resetForm = function() {
        return this.each(function() {
            if (typeof this.reset == "function" || typeof this.reset == "object" && !this.reset.nodeType)
                this.reset()
        })
    }
})(jQuery);
(function() {
    function t(e, n) {
        function c(t) {
            if (c[t] !== j)
                return c[t];
            var e;
            if ("bug-string-char-index" == t)
                e = "a" != "a"[0];
            else if ("json" == t)
                e = c("json-stringify") && c("json-parse");
            else {
                var r;
                if ("json-stringify" == t) {
                    e = n.stringify;
                    var o = "function" == typeof e && d;
                    if (o) {
                        (r = function() {
                            return 1
                        }).toJSON = r;
                        try {
                            o = "0" === e(0) && "0" === e(new i) && '""' == e(new a) && e(b) === j && e(j) === j && e() === j && "1" === e(r) && "[1]" == e([r]) && "[null]" == e([j]) && "null" == e(null) && "[null,null,null]" == e([j, b, null]) && '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}' == e({a: [r, !0, !1, null, "\x00\b\n\f\r	"]}) && "1" === e(null, r) && "[\n 1,\n 2\n]" == e([1, 2], null, 1) && '"-271821-04-20T00:00:00.000Z"' == e(new f(-864e13)) && '"+275760-09-13T00:00:00.000Z"' == e(new f(864e13)) && '"-000001-01-01T00:00:00.000Z"' == e(new f(-621987552e5)) && '"1969-12-31T23:59:59.999Z"' == e(new f(-1))
                        } catch (l) {
                            o = !1
                        }
                    }
                    e = o
                }
                if ("json-parse" == t) {
                    e = n.parse;
                    if ("function" == typeof e)
                        try {
                            if (0 === e("0") && !e(!1)) {
                                r = e('{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}');
                                var u = 5 == r.a.length && 1 === r.a[0];
                                if (u) {
                                    try {
                                        u = !e('"	"')
                                    } catch (s) {
                                    }
                                    if (u)
                                        try {
                                            u = 1 !== e("01")
                                        } catch (h) {
                                        }
                                    if (u)
                                        try {
                                            u = 1 !== e("1.")
                                        } catch (p) {
                                        }
                                }
                            }
                        } catch (g) {
                            u = !1
                        }
                    e = u
                }
            }
            return c[t] = !!e
        }
        e || (e = o.Object());
        n || (n = o.Object());
        var i = e.Number || o.Number, a = e.String || o.String, l = e.Object || o.Object, f = e.Date || o.Date, u = e.SyntaxError || o.SyntaxError, s = e.TypeError || o.TypeError, h = e.Math || o.Math, p = e.JSON || o.JSON;
        "object" == typeof p && p && (n.stringify = p.stringify, n.parse = p.parse);
        var l = l.prototype, b = l.toString, g, y, j, d = new f(-0xc782b5b800cec);
        try {
            d = -109252 == d.getUTCFullYear() && 0 === d.getUTCMonth() && 1 === d.getUTCDate() && 10 == d.getUTCHours() && 37 == d.getUTCMinutes() && 6 == d.getUTCSeconds() && 708 == d.getUTCMilliseconds()
        } catch (C) {
        }
        if (!c("json")) {
            var v = c("bug-string-char-index");
            if (!d)
                var S = h.floor, O = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], A = function(t, e) {
                return O[e] + 365 * (t - 1970) + S((t - 1969 + (e = +(1 < e))) / 4) - S((t - 1901 + e) / 100) + S((t - 1601 + e) / 400)
            };
            (g = l.hasOwnProperty) || (g = function(t) {
                var e = {}, r;
                (e.__proto__ = null, e.__proto__ = {toString: 1}, e).toString != b ? g = function(t) {
                    var e = this.__proto__;
                    t = t in(this.__proto__ = null, this);
                    this.__proto__ = e;
                    return t
                } : (r = e.constructor, g = function(t) {
                    var e = (this.constructor || r).prototype;
                    return t in this && !(t in e && this[t] === e[t])
                });
                e = null;
                return g.call(this, t)
            });
            y = function(t, e) {
                var n = 0, o, c, i;
                (o = function() {
                    this.valueOf = 0
                }).prototype.valueOf = 0;
                c = new o;
                for (i in c)
                    g.call(c, i) && n++;
                o = c = null;
                n ? y = 2 == n ? function(t, e) {
                    var r = {}, n = "[object Function]" == b.call(t), o;
                    for (o in t)
                        n && "prototype" == o || g.call(r, o) || !(r[o] = 1) || !g.call(t, o) || e(o)
                } : function(t, e) {
                    var r = "[object Function]" == b.call(t), n, o;
                    for (n in t)
                        r && "prototype" == n || !g.call(t, n) || (o = "constructor" === n) || e(n);
                    (o || g.call(t, n = "constructor")) && e(n)
                } : (c = "valueOf toString toLocaleString propertyIsEnumerable isPrototypeOf hasOwnProperty constructor".split(" "), y = function(t, e) {
                    var n = "[object Function]" == b.call(t), o, i = !n && "function" != typeof t.constructor && r[typeof t.hasOwnProperty] && t.hasOwnProperty || g;
                    for (o in t)
                        n && "prototype" == o || !i.call(t, o) || e(o);
                    for (n = c.length; o = c[--n]; i.call(t, o) && e(o))
                        ;
                });
                return y(t, e)
            };
            if (!c("json-stringify")) {
                var w = {92: "\\\\", 34: '\\"', 8: "\\b", 12: "\\f", 10: "\\n", 13: "\\r", 9: "\\t"}, T = function(t, e) {
                    return("000000" + (e || 0)).slice(-t)
                }, _ = function(t) {
                    for (var e = '"', r = 0, n = t.length, o = !v || 10 < n, c = o && (v ? t.split("") : t); r < n; r++) {
                        var i = t.charCodeAt(r);
                        switch (i) {
                            case 8:
                            case 9:
                            case 10:
                            case 12:
                            case 13:
                            case 34:
                            case 92:
                                e += w[i];
                                break;
                            default:
                                if (32 > i) {
                                    e += "\\u00" + T(2, i.toString(16));
                                    break
                                }
                                e += o ? c[r] : t.charAt(r)
                            }
                    }
                    return e + '"'
                }, N = function(t, e, r, n, o, c, i) {
                    var a, l, f, u, h, p, d, C, v;
                    try {
                        a = e[t]
                    } catch (O) {
                    }
                    if ("object" == typeof a && a)
                        if (l = b.call(a), "[object Date]" != l || g.call(a, "toJSON"))
                            "function" == typeof a.toJSON && ("[object Number]" != l && "[object String]" != l && "[object Array]" != l || g.call(a, "toJSON")) && (a = a.toJSON(t));
                        else if (a > -1 / 0 && a < 1 / 0) {
                            if (A) {
                                u = S(a / 864e5);
                                for (l = S(u / 365.2425) + 1970 - 1; A(l + 1, 0) <= u; l++)
                                    ;
                                for (f = S((u - A(l, 0)) / 30.42); A(l, f + 1) <= u; f++)
                                    ;
                                u = 1 + u - A(l, f);
                                h = (a % 864e5 + 864e5) % 864e5;
                                p = S(h / 36e5) % 24;
                                d = S(h / 6e4) % 60;
                                C = S(h / 1e3) % 60;
                                h %= 1e3
                            } else
                                l = a.getUTCFullYear(), f = a.getUTCMonth(), u = a.getUTCDate(), p = a.getUTCHours(), d = a.getUTCMinutes(), C = a.getUTCSeconds(), h = a.getUTCMilliseconds();
                            a = (0 >= l || 1e4 <= l ? (0 > l ? "-" : "+") + T(6, 0 > l ? -l : l) : T(4, l)) + "-" + T(2, f + 1) + "-" + T(2, u) + "T" + T(2, p) + ":" + T(2, d) + ":" + T(2, C) + "." + T(3, h) + "Z"
                        } else
                            a = null;
                    r && (a = r.call(e, t, a));
                    if (null === a)
                        return"null";
                    l = b.call(a);
                    if ("[object Boolean]" == l)
                        return"" + a;
                    if ("[object Number]" == l)
                        return a > -1 / 0 && a < 1 / 0 ? "" + a : "null";
                    if ("[object String]" == l)
                        return _("" + a);
                    if ("object" == typeof a) {
                        for (t = i.length; t--; )
                            if (i[t] === a)
                                throw s();
                        i.push(a);
                        v = [];
                        e = c;
                        c += o;
                        if ("[object Array]" == l) {
                            f = 0;
                            for (t = a.length; f < t; f++)
                                l = N(f, a, r, n, o, c, i), v.push(l === j ? "null" : l);
                            t = v.length ? o ? "[\n" + c + v.join(",\n" + c) + "\n" + e + "]" : "[" + v.join(",") + "]" : "[]"
                        } else
                            y(n || a, function(t) {
                                var e = N(t, a, r, n, o, c, i);
                                e !== j && v.push(_(t) + ":" + (o ? " " : "") + e)
                            }), t = v.length ? o ? "{\n" + c + v.join(",\n" + c) + "\n" + e + "}" : "{" + v.join(",") + "}" : "{}";
                        i.pop();
                        return t
                    }
                };
                n.stringify = function(t, e, n) {
                    var o, c, i, a;
                    if (r[typeof e] && e)
                        if ("[object Function]" == (a = b.call(e)))
                            c = e;
                        else if ("[object Array]" == a) {
                            i = {};
                            for (var l = 0, f = e.length, u; l < f; u = e[l++], (a = b.call(u), "[object String]" == a || "[object Number]" == a) && (i[u] = 1))
                                ;
                        }
                    if (n)
                        if ("[object Number]" == (a = b.call(n))) {
                            if (0 < (n -= n % 1))
                                for (o = "", 10 < n && (n = 10); o.length < n; o += " ")
                                    ;
                        } else
                            "[object String]" == a && (o = 10 >= n.length ? n : n.slice(0, 10));
                    return N("", (u = {}, u[""] = t, u), c, i, o, "", [])
                }
            }
            if (!c("json-parse")) {
                var U = a.fromCharCode, J = {92: "\\", 34: '"', 47: "/", 98: "\b", 116: "	", 110: "\n", 102: "\f", 114: "\r"}, m, x, k = function() {
                    m = x = null;
                    throw u()
                }, M = function() {
                    for (var t = x, e = t.length, r, n, o, c, i; m < e; )
                        switch (i = t.charCodeAt(m), i) {
                            case 9:
                            case 10:
                            case 13:
                            case 32:
                                m++;
                                break;
                            case 123:
                            case 125:
                            case 91:
                            case 93:
                            case 58:
                            case 44:
                                return r = v ? t.charAt(m) : t[m], m++, r;
                            case 34:
                                r = "@";
                                for (m++; m < e; )
                                    if (i = t.charCodeAt(m), 32 > i)
                                        k();
                                    else if (92 == i)
                                        switch (i = t.charCodeAt(++m), i) {
                                            case 92:
                                            case 34:
                                            case 47:
                                            case 98:
                                            case 116:
                                            case 110:
                                            case 102:
                                            case 114:
                                                r += J[i];
                                                m++;
                                                break;
                                            case 117:
                                                n = ++m;
                                                for (o = m + 4; m < o; m++)
                                                    i = t.charCodeAt(m), 48 <= i && 57 >= i || 97 <= i && 102 >= i || 65 <= i && 70 >= i || k();
                                                r += U("0x" + t.slice(n, m));
                                                break;
                                            default:
                                                k()
                                        }
                                    else {
                                        if (34 == i)
                                            break;
                                        i = t.charCodeAt(m);
                                        for (n = m; 32 <= i && 92 != i && 34 != i; )
                                            i = t.charCodeAt(++m);
                                        r += t.slice(n, m)
                                    }
                                if (34 == t.charCodeAt(m))
                                    return m++, r;
                                k();
                            default:
                                n = m;
                                45 == i && (c = !0, i = t.charCodeAt(++m));
                                if (48 <= i && 57 >= i) {
                                    for (48 == i && (i = t.charCodeAt(m + 1), 48 <= i && 57 >= i) && k(); m < e && (i = t.charCodeAt(m), 48 <= i && 57 >= i); m++)
                                        ;
                                    if (46 == t.charCodeAt(m)) {
                                        for (o = ++m; o < e && (i = t.charCodeAt(o), 48 <= i && 57 >= i); o++)
                                            ;
                                        o == m && k();
                                        m = o
                                    }
                                    i = t.charCodeAt(m);
                                    if (101 == i || 69 == i) {
                                        i = t.charCodeAt(++m);
                                        43 != i && 45 != i || m++;
                                        for (o = m; o < e && (i = t.charCodeAt(o), 48 <= i && 57 >= i); o++)
                                            ;
                                        o == m && k();
                                        m = o
                                    }
                                    return+t.slice(n, m)
                                }
                                c && k();
                                if ("true" == t.slice(m, m + 4))
                                    return m += 4, !0;
                                if ("false" == t.slice(m, m + 5))
                                    return m += 5, !1;
                                if ("null" == t.slice(m, m + 4))
                                    return m += 4, null;
                                k()
                        }
                    return"$"
                }, F = function(t) {
                    var e, r;
                    "$" == t && k();
                    if ("string" == typeof t) {
                        if ("@" == (v ? t.charAt(0) : t[0]))
                            return t.slice(1);
                        if ("[" == t) {
                            for (e = []; ; r || (r = !0)) {
                                t = M();
                                if ("]" == t)
                                    break;
                                r && ("," == t ? (t = M(), "]" == t && k()) : k());
                                "," == t && k();
                                e.push(F(t))
                            }
                            return e
                        }
                        if ("{" == t) {
                            for (e = {}; ; r || (r = !0)) {
                                t = M();
                                if ("}" == t)
                                    break;
                                r && ("," == t ? (t = M(), "}" == t && k()) : k());
                                "," != t && "string" == typeof t && "@" == (v ? t.charAt(0) : t[0]) && ":" == M() || k();
                                e[t.slice(1)] = F(M())
                            }
                            return e
                        }
                        k()
                    }
                    return t
                }, D = function(t, e, r) {
                    r = E(t, e, r);
                    r === j ? delete t[e] : t[e] = r
                }, E = function(t, e, r) {
                    var n = t[e], o;
                    if ("object" == typeof n && n)
                        if ("[object Array]" == b.call(n))
                            for (o = n.length; o--; )
                                D(n, o, r);
                        else
                            y(n, function(t) {
                                D(n, t, r)
                            });
                    return r.call(t, e, n)
                };
                n.parse = function(t, e) {
                    var r, n;
                    m = 0;
                    x = "" + t;
                    r = F(M());
                    "$" != M() && k();
                    m = x = null;
                    return e && "[object Function]" == b.call(e) ? E((n = {}, n[""] = r, n), "", e) : r
                }
            }
        }
        n.runInContext = t;
        return n
    }
    var e = typeof define === "function" && define.amd, r = {"function": !0, object: !0}, n = r[typeof exports] && exports && !exports.nodeType && exports, o = r[typeof window] && window || this, c = n && r[typeof module] && module && !module.nodeType && "object" == typeof global && global;
    !c || c.global !== c && c.window !== c && c.self !== c || (o = c);
    if (n && !e)
        t(o, n);
    else {
        var i = o.JSON, a = o.JSON3, l = !1, f = t(o, o.JSON3 = {noConflict: function() {
                l || (l = !0, o.JSON = i, o.JSON3 = a, i = a = null);
                return f
            }});
        o.JSON = {parse: f.parse, stringify: f.stringify}
    }
    e && define(function() {
        return f
    })
}).call(this);
(function(t) {
    t.fn.gLoad = function(e, i) {
        if (typeof e == "function") {
            e = {e: e}
        }
        if (parseInt(i) > 0) {
            e.df = i
        }
        var n = {df: 20, e: null, et: "scroll", ct: window};
        if (e) {
            t.extend(n, e)
        }
        var o = this;
        if ("scroll" == n.et) {
            t(n.ct).bind("scroll", function() {
                o.each(function() {
                    if (!t.gIsKs(this, n)) {
                        t(this).trigger("appear")
                    }
                });
                var e = t.grep(o, function(t) {
                    return!t.loaded
                });
                o = t(e)
            })
        }
        this.each(function() {
            var e = this;
            e.loaded = false;
            t(e).one("appear", function() {
                if (!this.loaded) {
                    if (n.e != null && n.e != "")
                        n.e.apply(e);
                    e.loaded = true
                }
            });
            if ("scroll" != n.et) {
                t(e).bind(n.et, function(i) {
                    if (!e.loaded) {
                        t(e).trigger("appear")
                    }
                })
            }
        });
        t(window).scroll();
        return this
    };
    t.gIsKs = function(e, i) {
        if (i.ct === undefined || i.ct === window) {
            var n = t(window).height() + t(window).scrollTop()
        } else {
            var n = t(i.ct).offset().top + t(i.ct).height()
        }
        return n <= t(e).offset().top - i.df
    }
})(jQuery);
this.searchInput();
function searchInput() {
    $(".topOvertips").click(function() {
        $(this).hide();
        $(this).siblings("input").focus()
    });
    $("#searchInput").focus(function() {
        $(".top_earch,.searchInput").addClass("focuscurs");
        $(".topOvertips").hide();
        $(this).siblings("label").hide()
    });
    $("#searchInput").blur(function() {
        $(".top_earch,.searchInput").removeClass("focuscurs");
        var e = $("#searchInput").val();
        if (e == "") {
            $(".topOvertips").show()
        } else {
            $(".topOvertips").hide()
        }
    })
}
function doSearch() {
    var e = $("#searchInput").val();
    if ($.trim(e) == "") {
        var t = $.trim($("#keyLabel").text());
        $("#keyLabel").hide();
        $("#searchInput").val(t)
    }
    if (e.length > 40) {
        e = e.substring(0, 40);
        $("#searchInput").val(e)
    }
    $("#searchForm").submit();
    return false
}
function keyCheck() {
    var e = $("#searchInput").val();
    if (e == "") {
        $("#searchInput").value = "手机";
        return false
    } else {
        $(".topOvertips").hide();
        var t = e.replace(/^\s+|\s+$/g, "");
        if (t == "") {
            $("#searchInput").value = "手机";
            return false
        } else {
            return true
        }
    }
}
function getDefaultKey(e) {
    var t;
    var a = 0;
    var r = "";
    var n;
    t = e.split(";");
    for (var s = 0; s < t.length; s++) {
        var l = parseInt(t[s].split(",")[1]);
        var u = parseInt($.cookie("key_default_value" + encodeURI(t[s].split(",")[0])) == null ? 0 : $.cookie("key_default_value" + encodeURI(t[s].split(",")[0])));
        var i = l - u;
        a += i;
        for (var o = 0; o < i; o++) {
            r += t[s].split(",")[0] + ","
        }
    }
    if (a != 0) {
        r = r.substring(0, r.length - 1);
        var c = parseInt(Math.random() * -a + a);
        n = $.trim(r.split(",")[c]);
        $.cookie("key_default_value" + encodeURI(n), parseInt($.cookie("key_default_value" + encodeURI(n)) == null ? 0 : $.cookie("key_default_value" + encodeURI(n))) + 1, {path: "/"})
    } else {
        for (var s = 0; s < t.length; s++) {
            $.cookie("key_default_value" + encodeURI($.trim(t[s].split(",")[0])), 0, {path: "/"})
        }
        n = getDefaultKey(e)
    }
    return n
}
$(function() {
    $("#searchInput").autopoint({suggest: "", url: "http://api.search" + cookieDomain + "/p/suggest?from=vipHeaderSearch", environment: "1" || "environment", targetType: "1" || "targetType", contentLabels: "1" || "contentLabels", language: "1" || "language"});
    var e = $("#keyLabel").attr("default");
    if (e != null && e != "") {
        var t = getDefaultKey(e);
        $("#keyLabel").text(t)
    }
    var a = $("#searchInput").val();
    if (a == null || a == "") {
        $("#keyLabel").show()
    } else {
        $("#keyLabel").hide()
    }
});
(function(e) {
    e.fn.adslide = function(t) {
        var o = {simg: "#gome-topad-sm", bimg: "#gome-topad-bg", closebtn: ".close-gome-topad", clbox: "#gome-topad", tbd: 1e3, tbu: 1e3, tsd: 1e3, tstop: 5e3, cusattr: "gome-src", stb: ".stop-gome-topad", re: ".open-gome-topad"};
        var t = e.extend(o, t), i = t.simg, n = t.bimg, s = t.tbd, c = t.tbu, r = t.tsd, h = t.tstop;
        closelink = t.closebtn, closebox = t.clbox, cmAttr = t.cusattr, endhide = t.stb, reshow = t.re;
        return this.each(function() {
            e.fn.adslide.srcChange = function(t) {
                t.each(function() {
                    if (e(this).attr("gome-src")) {
                        e(this).attr("src", e(this).attr("gome-src")).removeAttr("gome-src")
                    }
                })
            };
            e(i).find("img").load(function() {
                e(n).find("img").load(function() {
                    var t = e(i).height(), o = e(n).height(), s = null;
                    e(i).css({height: 0, overflow: "hidden"});
                    e(n).css({height: 0, overflow: "hidden"});
                    c(1);
                    s = setTimeout(function() {
                        c(0)
                    }, h);
                    function c(s) {
                        var c = e(n), r = e(i);
                        if (!s) {
                            c.stop().animate({height: t}, "slow", function() {
                                c.hide();
                                r.height(t);
                                e(reshow).show();
                                e(endhide).hide()
                            });
                            return
                        }
                        r.height(0);
                        c.show();
                        c.stop().animate({height: o}, "slow");
                        e(reshow).hide();
                        e(endhide).show()
                    }
                    e(endhide).click(function() {
                        clearTimeout(s);
                        c(0)
                    });
                    var r = true;
                    e(n).parents(".wbox").mouseover(function() {
                        clearTimeout(s)
                    });
                    e(n).parents(".wbox").mouseleave(function() {
                        if (r == true) {
                            r = false;
                            s = setTimeout(function() {
                                c(0)
                            }, h)
                        } else {
                            s = setTimeout(function() {
                                c(0)
                            }, h)
                        }
                    });
                    e(reshow).click(function() {
                        c(1);
                        s = setTimeout(function() {
                            c(0)
                        }, h)
                    })
                });
                e.fn.adslide.srcChange(e(n).find("img"))
            });
            e.fn.adslide.srcChange(e(i).find("img"));
            e(closelink).click(function() {
                e(closebox).remove()
            })
        })
    }
})(jQuery);
if (window.cartInfo) {
    var config = {dynSite: cartInfo.dynSite || dynSite, storeSite: cartInfo.contextPath || contextPath, imgServer: imgServer, secureURL: secureURL};
    var methodSite = cartInfo.methodSite || "homeus";
    var clink = config.dynSite + config.storeSite + cartInfo.cartLink;
    $(".cartlink").attr("href", clink)
} else {
    var config = {dynSite: dynSite, storeSite: contextPath, imgServer: imgServer, secureURL: secureURL};
    var methodSite = "homeus"
}
(function(t) {
    var e = '<div class="mini-products">                        <h2 class="hdrcartitle">最近加入的商品：</h2>                        <ul class="mini-nProductLists">                            <% for(var i=0;i<commerceItemsGroups.length;i++ ) { %>                            <li class="mini-list clearfix">                                <% var commerceItems = commerceItemsGroups[i] || {}; %>                                <dl class="nProduct-huod realMini">                                    <% if(commerceItems.promotionHeads && commerceItems.promotionHeads.length > 0 ) { %>                                        <dd data-sub="tit-sub" class="huod-hd clearfix">                                        <% for(var k=0; k< commerceItems.promotionHeads.length; k++) {%>                                        <% var promotionHead = commerceItems.promotionHeads[k] || [] ;%>                                            <% for(var l=0; l<promotionHead.length; l++) {%>                                            <% var promotionHeadItem = promotionHead[l] || {},label = promotionHeadItem.label; %>                                                <% if(promotionHeadItem.selected===true && promotionHeadItem.type != "NO_USE") {%>                                                    <div class="pCol-name-huod">                                                        <% if (promotionHeadItem.type === "GOME_MAN_JIAN") {%>                                                            <% var promotionTxt = ""; %>                                                            <% if(promotionHeadItem.satisfied && promotionHeadItem.shopId != "GOME") {%>                                                                <span class="ico-l">满减</span>                                                                <% promotionTxt = "活动商品已购满" + ($toFixed(promotionHeadItem.preCondition)) + "元（已减" + ($toFixed(promotionHeadItem.postCondition)) + "元）";%>                                                            <% } else {%>                                                                <% if(promotionHeadItem.satisfied) {%>                                                                    <span class="ico-l">满减</span>                                                                <% } else {%>                                                                    <span class="ico-l-gray"><i></i>满减</span>                                                                <% } %>                                                                <% promotionTxt = "活动商品购满" + ($toFixed(promotionHeadItem.preCondition)) + "元，即可享受优惠";%>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionTxt %>"><%=$cutstr(promotionTxt,26)  %></span>                                                        <% } else if (promotionHeadItem.type === "GOME_MAN_FAN"){ %>                                                            <% var promotionTxt = ""; %>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">满返</span>                                                                <% promotionTxt = "活动商品已购满" + ($toFixed(promotionHeadItem.preCondition)) + "元";%>                                                                <% if (promotionHeadItem.returnedCouponVOs && promotionHeadItem.returnedCouponVOs.length) {%>                                                                    <% promotionTxt += "(下单可返"; %>                                                                    <% for(var p =0 ; p<promotionHeadItem.returnedCouponVOs.length; p ++) {%>                                                                        <% if(p > 0) {promotionTxt += " , "}%>                                                                        <% promotionTxt += ($toFixed(promotionHeadItem.returnedCouponVOs[p].faceValue)) + "元"; %>                                                                        <% if (promotionHeadItem.returnedCouponVOs[p].couponType == "BLUECOUPON") {promotionTxt += "蓝券";} else {promotionTxt += "红券";}%>                                                                        <% promotionTxt += "x" + promotionHeadItem.returnedCouponVOs[p].quantity || 0;%>                                                                    <% }%>                                                                    <% promotionTxt += ")"; %>                                                                <% }%>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>满返</span>                                                                <% promotionTxt = "活动商品购满" + ($toFixed(promotionHeadItem.preCondition)) + "元，即可享受满返";%>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionTxt %>"><%=$cutstr(promotionTxt,26)  %></span>                                                        <% } else if (promotionHeadItem.type === "GOME_MAN_ZENG") {%>                                                            <% if(!promotionHeadItem.satisfied) {%><i></i><% } %>                                                            <span class="ico-l">满赠</span>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,26)  %></span>                                                        <% } else if (promotionHeadItem.type === "GOME_JIA_JIA_HUAN_GOU") {%>                                                            <% var promotionTxt = ""; %>                                                            <% if(promotionHeadItem.satisfied && promotionHeadItem.shopId != "GOME") {%>                                                                <span class="ico-l">加价购</span>                                                            <% } else {%>                                                                <% if(promotionHeadItem.satisfied) {%>                                                                    <span class="ico-l">加价购</span>                                                                <% } else {%>                                                                    <span class="ico-l-gray"><i></i>加价购</span>                                                                <% } %>                                                            <% } %>                                                            <% if(!promotionHeadItem.satisfied) {%>                                                                <% promotionTxt = "活动商品购满" + ($toFixed(promotionHeadItem.preCondition)) + "元，即可加价换购商品" + (promotionHeadItem.maxNum || "0") + "件";%>                                                            <% } else {%>                                                                <% promotionTxt = "活动商品已购满" + ($toFixed(promotionHeadItem.preCondition)) + "元，可加价换购商品" + (promotionHeadItem.maxNum || "0") + "件";%>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionTxt %>"><%=$cutstr(promotionTxt,24)  %></span>                                                        <% } else if (promotionHeadItem.type === "GOME_MAN_ZHE") {%>                                                             <% var promotionTxt = ""; %>                                                            <% if(promotionHeadItem.satisfied && promotionHeadItem.shopId != "GOME") {%>                                                                <span class="ico-l">满折</span>                                                                <% promotionTxt = "活动商品已购满" + (promotionHeadItem.preCondition || "0") + "件（已减" + ($toFixed(promotionHeadItem.postCondition)) + "元）";%>                                                            <% } else {%>                                                                <% if(promotionHeadItem.satisfied) {%>                                                                    <span class="ico-l">满折</span>                                                                <% } else {%>                                                                    <span class="ico-l-gray"><i></i>满折</span>                                                                <% } %>                                                                <% promotionTxt = "活动商品购满" + (promotionHeadItem.preCondition || "0") + "件，即可享受满折";%>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionTxt %>"><%=$cutstr(promotionTxt,26)  %></span>                                                        <% } else if (promotionHeadItem.type === "GOME_DA_PEI_GOU") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">搭配购</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>搭配购</span>                                                            <% } %>                                                            <span class="nLowLeight " title="搭配折扣购组合">搭配折扣购组合</span>                                                        <% } else if (promotionHeadItem.type === "NPOP_KDP_MJ") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">跨店铺满减</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>跨店铺满减</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,20)  %></span>                                                        <% } else if (promotionHeadItem.type === "NPOP_KDP_MM") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">跨店铺满免</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>跨店铺满免</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,20)  %></span>                                                        <% } else if (promotionHeadItem.type === "NPOP_SHOP_MAN_JIAN") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">满减</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>满减</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,26)  %></span>                                                        <% } else if (promotionHeadItem.type === "NPOP_SHOP_MAN_FAN") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">满返</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>满返</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,26)  %></span>                                                        <% } else if (promotionHeadItem.type === "NPOP_SHOP_MAN_ZENG") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">满赠</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>满赠</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,26)  %></span>                                                        <% } else if (promotionHeadItem.type === "NPOP_SHOP_JIA_JIA_HUAN_GOU") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">加价购</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>加价购</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,24)  %></span>                                                        <% } else if (promotionHeadItem.type === "NPOP_SHOP_MAN_ZHE") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">多买优惠</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>多买优惠</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,24)  %></span>                                                        <% } else if (promotionHeadItem.type === "NPOP_SHOP_GOUWUQUAN") {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">购物券</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>购物券</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,24)  %></span>                                                        <% } else {%>                                                            <% if(promotionHeadItem.satisfied) {%>                                                                <span class="ico-l">促销</span>                                                            <% } else {%>                                                                <span class="ico-l-gray"><i></i>促销</span>                                                            <% } %>                                                            <span class="nLowLeight " title="<%= promotionHeadItem.label %>"><%=$cutstr(label,26)  %></span>                                                        <% } %>                                                    </div>                                                <% } %>                                            <% } %>                                        <%} %>                                        <% if(commerceItems.pomotionSummary && commerceItems.pomotionSummary.promtion && commerceItems.pomotionSummary.subAmount > 0) {%>                                            <p style="padding-left:8px;">                                                小计：<span class="yuan" style="margin-right:10px;"> <b>¥</b><%= $toFixed(commerceItems.pomotionSummary.subAmount) %></span>                                                <% if(commerceItems.pomotionSummary.promoDiscAmount > 0) {%>                                                    <span class="nRed">已减：<%= $toFixed(commerceItems.pomotionSummary.promoDiscAmount)%>元</span>                                                <% } %>                                            </p>                                        <%} %>                                        </dd>                                    <%} %>                                    <% var commerceItemsGroup = commerceItems.commerceItemsGroup || [];%>                                    <% for(var j=0; j< commerceItemsGroup.length; j++) {%>                                    <% var commerceItem = commerceItemsGroup[j] || {}; %>                                    <dd class="mini-huod-list min-sideline-list clearfix">                                        <div class="mini-product-info clearfix">                                            <div class="mini-pCol-img">                                                <a target="_blank" title="<%= commerceItem.itemName %>" href="<%= commerceItem.itemURL %>">                                                    <img alt="" src="<%= commerceItem.itemImageURL %>" width="50" height="50"></a>                                            </div>                                            <div class="mini-pCol-name">                                                <p>                                                    <a target="_blank" class="nBlue" title="<%= commerceItem.itemName %>" href="<%= commerceItem.itemURL %>"><%=$cutstr(commerceItem.itemName,56)  %></a>                                                </p>                                            </div>                                            <div class="mini-pCol-row">                                                <span class="yuan"><b>¥<%= $toFixed(commerceItem.salePrice) %></b></span>                                                <span  class="quantity"><%= commerceItem.quantity %></span>                                                <span isClick="" mcart-count mcart-count-min="1"                                                        mcart-count-change-interval="100"                                                        mcart-change-count                                                        data-cid="<%= commerceItem.itemId %>"                                                        data-limit="<%= commerceItem.limitNum %>"class="mcart-count">                                                        <a href="javascript:;" type="down" mcart-count-sub class="mcart-count-btn mcart-count-sub  <% if(commerceItem.quantity ==1) {%>mcart-count-disabled<% } %> ">-</a>                                                        <a href="javascript:;" type="up" mcart-count-add class=" <% if(commerceItem.quantity >= commerceItem.limitNum  ) {%>mcart-count-disabled<% } %>  mcart-count-btn mcart-count-add  ">+</a>                                                        <div class="mcart-count-input"><input  maxlength="3" name="num" type="text" value="<%= commerceItem.quantity %>">                                                        </div>                                                </span>                                                <a class="nLowLeight miniDel" href="javascript:void(0)" title="删除" data-itemid="<%= commerceItem.itemId %>">删除</a>                                            </div>                                        </div>                                        <% var warrantyItems = commerceItem.warrantyItems || [], commerceItemVOs = commerceItem.commerceItemVOs || [];%>                                        <% if(warrantyItems.length > 0 || commerceItemVOs.length > 0) {%>                                        <div class="mini-pCol-promotion fl">                                            <%for(var k=0;k<warrantyItems.length;k++) {%>                                                <% if(warrantyItems[k].selected === true) {%>                                                    <% var dName = (warrantyItems[k].warrantyType === "SPECIAL" ? "特惠" : "") + ("延长保修" + warrantyItems[k].numOfYear + "年￥" + $toFixed(warrantyItems[k].price)); %>                                                    <p class="nLowLeight cou-gift" title="<%=dName %>">[<em>延保</em>]&nbsp;&nbsp;<%=$cutstr(dName,24)  %></p>                                                <% } %>                                            <% } %>                                            <% for(var h=0;h<commerceItemVOs.length;h++) {%>                                                <% var itemName = commerceItemVOs[h].itemName || ""; %>                                                <p class="nLowLeight cou-gift" title="<%=itemName %>">[<em>赠品</em>]&nbsp;&nbsp;<%=$cutstr(itemName,24)  %> </p>                                            <% } %>                                        </div>                                        <% } %>                                    </dd>                                    <% } %>                                </dl>                            </li>                            <% } %>                        </ul>                        <div id="atg_store_csFooter1" class="cartfooter">                            <h4>                                已选 <i><span id="csQuantity"><%= cartProfile.itemCount || 0 %></span></i>                                 件 ，共计： <strong><span id="csSubtotal">¥</span><%= $toFixed(cartProfile.totalAmount) %></strong>                            </h4>                            <% if(isUpCart) {%>                                <a  data-code="cart01002" id="csCheckout" style="text-decoration:none;" class="gocart" href="http://cart' + cookieDomain + '/" title="去购物车">                                    <span>                                        去购物车                                    </span>                                </a>                            <% } else {%>                                <a  data-code="cart01001" id="csCheckout" style="text-decoration:none;" class="gocart" href="http://cart' + cookieDomain + '/" title="去购物车">                                    <span>                                        去购物车                                    </span>                                </a>                            <% } %>                        </div>                    </div>';
    var o = '<div carttype="asidecart"  id="csEmptyMessage" class="noshop">                        <% if(isUpCart) {%>                            <a data-code="cart01002" href="http://cart' + cookieDomain + '/" title="去购物车" style="text-decoration:underline;">购物车</a>                        <% } else {%>                            <a data-code="cart01001" href="http://cart' + cookieDomain + '/" title="去购物车" style="text-decoration:underline;">购物车</a>                        <% } %>                        中还没有商品，赶紧选购吧！</div>';
    var i = {loadCart: "http://cart" + cookieDomain + "/home/api/cart/loadMiniCart", delCartItem: "http://cart" + cookieDomain + "/home/api/cart/removeItem", changeNum: "http://cart" + cookieDomain + "/home/api/cart/changeNum"};
    var n = {renderCart: p, reqMiniCart: s, isFail: l, cartEvents: I, isEmptyCart: v, renderEmptyCart: y, minloadCart: g, doActionCart: c, reqChangeNum: d, qtyUpdate: f, tplHelp: m, twoScroll: h, STATE: {scroll: 0, scroll2: 0}, twoCartH: r};
    function r(t) {
        var e = {upCart: 0, asideCart: 0};
        if (t.attr("carttype") !== "up") {
            e.asideCart = $("#gome-bar-cart").height() - 154;
            $(".gminicart .mini-nProductLists").css({"overflow-y": "auto", height: e.asideCart, "overflow-x": "hidden"})
        } else {
            return
        }
    }
    function s() {
        return $.ajax({dataType: "jsonp", type: "get", url: i.loadCart})
    }
    function m() {
        template.helper("$cutstr", function(t, e) {
            var o = 0;
            var i = 0;
            str_cut = new String;
            i = t.length;
            for (var n = 0; n < i; n++) {
                a = t.charAt(n);
                o++;
                if (escape(a).length > 4) {
                    o++
                }
                str_cut = str_cut.concat(a);
                if (o >= e) {
                    str_cut = str_cut.concat("...");
                    return str_cut
                }
            }
            if (o < e) {
                return t
            }
        });
        template.helper("$toFixed", function(t) {
            return parseFloat(t || 0).toFixed(2)
        })
    }
    function c(t) {
        return function(e) {
            if (l(e))
                return;
            e.isUpCart = t.attr("carttype") == "up";
            if (e.data)
                e.data.isUpCart = e.isUpCart;
            m();
            if (v(e)) {
                window.signData.lazyCart(true);
                y(t, e);
                return
            }
            p(t, e);
            h();
            r(t);
            $("#miniShoppingcartLoadId .mini-nProductLists").scrollTop(n.STATE.scroll);
            $(".gminicart .mini-nProductLists").scrollTop(n.STATE.scroll2);
            I(t, e);
            window.signData.lazyCart(true)
        }
    }
    function p(t, a) {
        var o = template.compile(e);
        return t.html(o(a.data))
    }
    function l(t) {
        return t.errCode !== "0"
    }
    function d(t, e) {
        var a = t.next().find("input").val();
        var o = t.parent("span").data("cid");
        return $.ajax({type: "get", dataType: "jsonp", data: {cid: o, pcount: e}, url: i.changeNum})
    }
    function u(t) {
        return $.ajax({type: "get", dataType: "jsonp", data: {cid: t.cid, pcount: t.pcount}, url: i.changeNum})
    }
    function f(t, e, a, o) {
        var i = t.parent().find("input").val();
        var n = i;
        var r = t.parent().data("limit");
        if (t.hasClass("mcart-count-disabled")) {
            t.off("click")
        }
        if (e == "up") {
            if (t.parent().attr("isClick") == "") {
                t.parent().attr("isClick", "yet");
                n++;
                if (n > r) {
                    t.parent().attr("isClick", "");
                    return
                }
                d(t, n).then(function() {
                    s().then(c(a))
                })
            }
        } else if (e == "down") {
            if (t.parent().attr("isClick") == "") {
                t.parent().attr("isClick", "yet");
                if (n > 1) {
                    n--
                } else {
                    t.parent().attr("isClick", "");
                    return
                }
                d(t, n).then(function() {
                    s().then(c(a))
                })
            }
        }
        t.next(".mcart-count-input").children("input").val(n);
        t.parent().prev(".quantity").html(n)
    }
    function h() {
        $("#miniShoppingcartLoadId .mini-nProductLists").scroll(function() {
            n.STATE.scroll = $(this).scrollTop()
        });
        $(".gminicart .mini-nProductLists").scroll(function() {
            n.STATE.scroll2 = $(this).scrollTop()
        })
    }
    function I(t, e) {
        t.find(".miniDel").on("click", function() {
            var e = $(this).attr("data-itemid");
            $.ajax({dataType: "jsonp", type: "get", url: i.delCartItem, data: {cid: e}}).then(function() {
                s().then(c(t))
            })
        });
        t.find(".mcart-count-input input").each(function() {
            var e = $(this);
            var a = $(this).parent().parent().prev(".quantity").html();
            $(this).on("input keyup ", function(o) {
                this.value = this.value.replace(/\D/g, "");
                var i = e.parent().parent().data("limit");
                if (o.keyCode == "13" || o.keyCode == "108") {
                    var n = this.value;
                    if (n > i) {
                        n = a
                    }
                    if (n < 1) {
                        n == 1
                    }
                    $(this).parent().parent().prev(".quantity").html(n);
                    var r = {cid: $(this).parent().parent().data("cid"), pcount: this.value};
                    u(r).then(function() {
                        s().then(c(t))
                    })
                }
            }).on("focus", function() {
                this.value == a
            }).on("blur", function() {
                if (a == this.value) {
                    return
                }
                $(this).parent().parent().prev(".quantity").html(this.value);
                var e = {cid: $(this).parent().parent().data("cid"), pcount: this.value};
                u(e).then(function() {
                    s().then(c(t))
                })
            })
        });
        t.find("[mcart-count-add]").each(function() {
            var a = $(this);
            var o = $(this).attr("type");
            $(this).on("click", function() {
                f(a, o, t, e)
            })
        });
        t.find("[mcart-count-sub]").each(function() {
            var a = $(this);
            var o = $(this).attr("type");
            $(this).on("click", function() {
                f(a, o, t, e)
            })
        })
    }
    function v(t) {
        if (t.data.cartProfile == null || t.data.commerceItemsGroups.length === 0) {
            return true
        }
    }
    function y(t, e) {
        var a = template.compile(o);
        var i = a(e);
        return t.html(i)
    }
    function g(t) {
        t = t || $("#miniShoppingcartLoadId");
        t.attr("carttype", "up");
        s().then(c(t))
    }
    $.fn.extend({gminicart: function() {
            var t = $(this).addClass("gminicart");
            t.attr("carttype", "right");
            s().then(c(t))
        }});
    $(function() {
        var t, e;
        $(".shopcartbox").hover(function() {
            clearTimeout(e);
            e = setTimeout(function() {
                $(".shopcartbox").addClass("hover")
            }, 150)
        }, function() {
            clearTimeout(e);
            $(this).removeClass("hover")
        });
        $(".cartlink, .ucCart").unbind().hover(function() {
            cartUnit.minloadCart()
        }, function() {
        }).attr("href", "http://cart" + cookieDomain + "/")
    });
    t.cartUnit = {minloadCart: g}
})(window);
(function(e) {
    e.fn.gclickshow = function(i) {
        var s = {hbox: ".jhbox", Class: "hover"};
        var i = e.extend(s, i), n = i.hbox, h = i.Class, o = e(this);
        return this.each(function() {
            e(n).hide();
            e(this).click(function() {
                if (e(n).is(":hidden")) {
                    e(n).show();
                    e(o).addClass(h)
                } else {
                    e(n).hide();
                    e(o).removeClass(h)
                }
            });
            e(n).hover(function() {
            }, function() {
                e(n).hide();
                e(o).removeClass(h)
            })
        })
    }
})(jQuery);
(function(t) {
    t.fn.ghover = function(e) {
        var a = {targetId: "self", addcss: "cur", latertime: 150, prat: 0, e: null, pratclass: "pcur"};
        var e = t.extend(a, e), r = e.targetId, s = e.addcss, n = e.latertime, i = e.prat, c = e.pratclass, l;
        return this.each(function() {
            if (r == "self") {
                var a = t(this)
            } else {
                var a = e.targetId
            }
            t(this).hover(function() {
                function r() {
                    t(a).addClass(s);
                    if (e.e) {
                        e.e.apply(a)
                    }
                }
                l = setTimeout(r, n)
            }, function() {
                t(a).removeClass(s);
                clearTimeout(l)
            });
            if (i == 1) {
                t(a).parent().hover(function() {
                    t(this).addClass(c)
                }, function() {
                    t(this).removeClass(c)
                })
            }
        })
    }
})(jQuery);
(function(i) {
    i.fn.ginputfocus = function(s) {
        var n = {curClass: "cur"};
        var s = i.extend(n, s), t = s.curClass;
        return this.each(function() {
            var s = i(this).siblings("label");
            i(s).click(function() {
                i(this).hide();
                i(this).siblings("input").focus()
            });
            i(this).focus(function() {
                i(this).parent().addClass(t);
                i(this).siblings("label").hide()
            });
            i(this).blur(function() {
                i(this).parent().removeClass(t);
                if (this.value == "") {
                    i(this).siblings("label").show()
                }
            })
        })
    }
})(jQuery);
(function(t) {
    t.fn.glaterimg = function(i) {
        var n = {rattr: "gome-src"};
        var i = t.extend(n, i), r = i.rattr;
        return this.each(function() {
            t(this).hover(function() {
                t(this).find("img").each(function() {
                    var i = t(this).attr(r);
                    if (i != undefined) {
                        this.src = t(this).attr(r);
                        t(this).removeAttr(r)
                    }
                })
            }, function() {
            })
        })
    }
})(jQuery);
(function(r) {
    r.fn.greplaceimg = function(t) {
        var n = {narrow: 1024, rpimg: "grey.gif", cusattr: "gome-src"};
        var t = r.extend(n, t), i = screen.width, a = t.narrow, s = t.rpimg;
        nAttr = t.cusattr;
        return this.each(function() {
            var t = r(this).find("img");
            t.each(function() {
                var t = "src";
                var n = r(this).attr("src");
                if (n.indexOf(s) != -1) {
                    t = nAttr;
                    n = r(this).attr(nAttr)
                }
                if (i <= a) {
                    var e = n.lastIndexOf(".");
                    var c = n.substring(0, e) + "_s" + n.substring(e);
                    r(this).attr(t, c)
                }
            })
        })
    }
})(jQuery);
(function(e) {
    e.fn.gshowhide = function(i) {
        var n = {box: ".jhbox", Class: "current", latertime: 150, bind: "click"};
        var i = e.extend(n, i), o = i.box, s = i.Class, t = e(this), h = i.bind, c = i.latertime, r;
        return this.each(function() {
            e(o).hide();
            e(this).click(function() {
                if (e(o).is(":hidden")) {
                    e(o).show();
                    e(t).addClass(s)
                } else {
                    e(o).hide();
                    e(t).removeClass(s)
                }
            });
            e(o).hover(function() {
            }, function() {
                e(o).hide();
                e(t).removeClass(s)
            });
            if (h = "hover") {
                e(t).hover(function() {
                    function i() {
                        e(o).show();
                        e(t).addClass(s)
                    }
                    r = setTimeout(i, c)
                }, function() {
                    e(o).hide();
                    e(t).removeClass(s);
                    clearTimeout(r)
                })
            }
        })
    }
})(jQuery);
(function(i) {
    i.fn.gbackTop = function(n) {
        var o = {st: 100, box: "fixed", callback: function() {
            }}, c = null;
        n = i.extend({}, o, n);
        i(window).bind("scroll", function() {
            if (c) {
                clearTimeout(c)
            }
            var o = i(this);
            c = setTimeout(function() {
                t(o);
                n.callback()
            }, 100)
        });
        function t(o) {
            o = o || i(window);
            if (o.scrollTop() > n.st) {
                i(n.box).css("visibility", "visible");
                return
            }
            i(n.box).css("visibility", "hidden")
        }}
})(jQuery);
(function(n) {
    n.fn.curNav = function(a) {
        var r = {nav: ".mainnav", css: "cur"};
        var a = n.extend(r, a), e = a.nav, i = a.css;
        return this.each(function() {
            var a = n(e).find("a");
            for (var r = 0; r < a.length; r++) {
                var t = a.eq(r).attr("href");
                var f = document.location.href;
                if (f.indexOf(t) != -1) {
                    n(e).find("li").removeClass(i);
                    a.eq(r).parent("li").addClass(i)
                }
            }
        })
    }
})(jQuery);
(function(i) {
    var t = {};
    function e(i) {
        this._init(i || {})
    }
    e.prototype = {contructor: e, _init: function(i) {
            this._fixOptions(i);
            var t = this.$container = i.$container;
            if (!t.width() && !t.height()) {
                throw new Error("gSlider: can not get size of container.")
            }
            this.$images = this.$container.children();
            this.$images.remove();
            this.index = 0;
            this.length = this.$images.length;
            this.maxIndex = this.length - 1;
            this._gomeLazyLoad(0);
            this._initContainer();
            this._initSlider();
            if (i.control && i.control.index) {
                this._initControlIndex()
            }
            if (i.control && i.control.side) {
                this._initControlSide()
            }
            this._startTimer()
        }, _fixOptions: function(i) {
            this.options = i;
            if (this.options && this.options.type) {
                this.type = this.options.type
            } else {
                this.type = "slideLeft"
            }
            this.adapter = t[this.type];
            this.delayTime = parseInt(this.options.delayTime) || 1e3;
            this.animateTime = parseInt(this.options.animateTime) || 500
        }, _initContainer: function() {
            if (this.$container.css("position") == "static") {
                this.$container.css("position", "relative")
            }
            this.containerWidth = this.$container.width();
            this.containerHeight = this.$container.height()
        }, _initSlider: function() {
            var t = this.adapter;
            if (typeof t.initSlider == "function") {
                var e = this.$slider = t.initSlider.call(this)
            } else {
                var e = i("<div>");
                this.$images.appendTo(e).hide().eq(0).show()
            }
            this.$container.append(e);
            var n = this.containerWidth;
            var a = this.containerHeight;
            e.css({position: "relative", width: n, height: a});
            this.$images.css({width: n, height: a, position: "absolute", left: 0, top: 0})
        }, _initControlIndex: function() {
            var t = this;
            var e = t.options.control.index.html;
            var n = this.$controlIndex = i("<div>");
            this.$images.each(function(t) {
                var a = i("<div>");
                if (e) {
                    a.append(e.replace(/\\?\$/g, function(i) {
                        return i.indexOf("\\") > -1 ? "$" : t + 1
                    }))
                }
                n.append(a)
            });
            var a = this.options.control.index.className;
            if (a) {
                n.addClass(a)
            }
            var s = this.options.control.index.activeClassName;
            if (s) {
                this.$controlIndex.children().removeClass(s).eq(this.index).addClass(s)
            }
            var o = this.options.control.index.event;
            if (o) {
                n.children().each(function(e) {
                    i(this).on(o, function() {
                        t._animateTo(e);
                        t._stopTimer();
                        t._startTimer()
                    })
                })
            }
            this.$container.append(n);
            var r = this.options.control.index.autoHideTime;
            if (typeof r == "number") {
                this.$container.on("mouseenter", function() {
                    n.stop().animate({opacity: n.data("autoHideOpacity")}, r)
                });
                this.$container.on("mouseleave", function() {
                    n.stop().animate({opacity: 0}, r)
                });
                n.data("autoHideOpacity", n.css("opacity")).css({opacity: 0})
            }
        }, _initControlSide: function() {
            var t = this;
            var e = this.options.control.side;
            var n = e.prev;
            var a = e.next;
            var s = this.$controlSidePrev = i("<div>");
            var o = this.$controlSideNext = i("<div>");
            if (e.className) {
                s.addClass(e.className);
                o.addClass(e.className)
            }
            if (n && n.className) {
                s.addClass(n.className)
            }
            if (a && a.className) {
                o.addClass(a.className)
            }
            if (n && n.html) {
                s.append(n.html)
            }
            if (a && a.html) {
                o.append(a.html)
            }
            this.$container.append(s).append(o);
            s.on("click", function() {
                t._animatePrev();
                t._stopTimer();
                t._startTimer()
            });
            o.on("click", function() {
                t._animateNext();
                t._stopTimer();
                t._startTimer()
            });
            var r = this.options.control.side.autoHideTime;
            if (typeof r == "number") {
                this.$container.on("mouseenter", function() {
                    s.stop().animate({opacity: s.data("autoHideOpacity")}, r)
                });
                this.$container.on("mouseleave", function() {
                    s.stop().animate({opacity: 0}, r)
                });
                this.$container.on("mouseenter", function() {
                    o.stop().animate({opacity: o.data("autoHideOpacity")}, r)
                });
                this.$container.on("mouseleave", function() {
                    o.stop().animate({opacity: 0}, r)
                });
                s.data("autoHideOpacity", s.css("opacity")).css({opacity: 0});
                o.data("autoHideOpacity", o.css("opacity")).css({opacity: 0})
            }
        }, _startTimer: function() {
            var i = this;
            this.$container.trigger("gSlider.start");
            this._timer = setInterval(function() {
                i._animateNext()
            }, this.delayTime + this.animateTime)
        }, _stopTimer: function() {
            var i = this;
            this.$container.trigger("gSlider.stop");
            clearInterval(this._timer);
            this._timer = null
        }, _gomeLazyLoad: function(i) {
            var t = this.$images.eq(i);
            if (t.get(0).tagName.toLowerCase() !== "img") {
                t = t.find("img")
            }
            if (t.attr("gome-src") && t.attr("src") !== t.attr("gome-src")) {
                t.attr("src", t.attr("gome-src"))
            }
        }, _animateTo: function(i) {
            if (i == this.index) {
                return
            }
            this._gomeLazyLoad(i);
            this.adapter.animateTo.call(this, i);
            this.index = i;
            this.$container.trigger("gSlider.change");
            if (this.$controlIndex) {
                var t = this.options.control.index.activeClassName;
                if (t) {
                    this.$controlIndex.children().removeClass(t).eq(i).addClass(t)
                }
            }
        }, _animatePrev: function() {
            var i = this.index - 1;
            if (i < 0) {
                i = this.maxIndex
            }
            this._animateTo(i)
        }, _animateNext: function() {
            var i = this.index + 1;
            if (i > this.maxIndex) {
                i = 0
            }
            this._animateTo(i)
        }, destory: function() {
            this._stopTimer();
            this.$container.off().find("*").off();
            this.$container.html("").append(this.$images)
        }};
    i.gSlider = {};
    i.gSlider.register = function(i) {
        t[i.type] = i
    };
    i.gSlider.register({type: "slideLeft", initSlider: function() {
            var t = i("<div>");
            this.$images.appendTo(t).hide().eq(0).show();
            return t
        }, animateTo: function(t) {
            var e = this.$images;
            var n = this.containerWidth;
            e.hide();
            e.eq(this.index).css({left: 0}).stop().show().animate({left: -n}, this.animateTime, function() {
                i(this).hide()
            });
            e.eq(t).css({left: n}).stop().show().animate({left: 0}, this.animateTime)
        }});
    i.gSlider.register({type: "fadeIn", animateTo: function(t) {
            var e = this.$images;
            var n = this.containerWidth;
            e.hide();
            e.eq(this.index).css({opacity: 1}).stop().show().animate({opacity: 0}, this.animateTime, function() {
                i(this).hide()
            });
            e.eq(t).css({opacity: 0}).stop().show().animate({opacity: 1}, this.animateTime)
        }});
    i.fn.gSlider = function(t) {
        t = t || {};
        this.each(function() {
            var n = i(this);
            t.$container = n;
            if (n.data("_gSlider")) {
                try {
                    n.data("_gSlider").destory()
                } catch (a) {
                }
            }
            n.data("_gSlider", new e(t))
        });
        return this
    }
})(jQuery);
(function(t) {
    var e = t(window), o = t(document), i = t("body");
    var n = function() {
        var t = !-[1] && !window.XMLHttpRequest, e = document.getElementsByTagName("html")[0], o = document.documentElement, i = document.body, n = o || i, s = function(t) {
            return{left: Math.max(o.scrollLeft, i.scrollLeft), top: Math.max(o.scrollTop, i.scrollTop)}
        };
        if (t && document.body.currentStyle.backgroundAttachment !== "fixed") {
            e.style.backgroundImage = "url(about:blank)";
            e.style.backgroundAttachment = "fixed"
        }
        return{fixed: t ? function(t) {
                var e = t.style, o = s(), i = "(document.documentElement || document.body)", n = parseInt(e.left) - o.left, c = parseInt(e.top) - o.top;
                this.absolute(t);
                e.setExpression("left", "eval(" + i + ".scrollLeft + " + n + ') + "px"');
                e.setExpression("top", "eval(" + i + ".scrollTop + " + c + ') + "px"')
            } : function(t) {
                t.style.position = "fixed"
            }, absolute: t ? function(t) {
                var e = t.style;
                e.position = "absolute";
                e.removeExpression("left");
                e.removeExpression("top")
            } : function(t) {
                t.style.position = "absolute"
            }}
    }(), s = function(t) {
        var e = i.width(), n = t.outerWidth(), s = t.offset().left, c = o.height(), l = t.outerHeight(), r = t.offset().top;
        var a = e > s + n ? s : s - (n + s - e);
        var u = c > r + l ? r : r - (l + r - c);
        return{left: a, top: u}
    };
    var c = function(t, e) {
        this.target = t;
        this.settings = e;
        this.IE6 = !-[1] && !window.XMLHttpRequest;
        this.timer = null;
        this.init()
    };
    c.prototype = {init: function() {
            var t = this;
            t.closePrevPop();
            t.settings.beforeCallback(t);
            if (t.settings.isColseBtn) {
                t.createClose()
            }
            if (t.settings.isLock) {
                t.createLock()
            }
            if (typeof t.settings.time === "number") {
                t.timer = setTimeout(function() {
                    t.closePop()
                }, t.settings.time)
            }
            t.bindEvent();
            t.showTarget()
        }, showTarget: function() {
            var t = this, o = t.target, i, s;
            o.addClass("prevPopBox").show();
            if (t.settings.middile) {
                i = Math.round((e.width() - o.outerWidth()) / 2);
                s = Math.round((e.height() - o.outerHeight()) / 2);
                if (t.IE6) {
                    var c = document.documentElement.scrollTop || document.body.scrollTop;
                    i = Math.round((e.width() - o.outerWidth()) / 2);
                    s = Math.round((document.documentElement.clientHeight - o.outerHeight()) / 2) + c
                }
                o.css({left: i, top: s, "z-index": t.settings.zIndex + 1});
                n.fixed(o[0]);
                return
            }
        }, createLock: function() {
            var e = this;
            if (t("#popLock").length > 0) {
                t("#popLock").show();
                return false
            }
            e.Lock = t('<div id="popLock" style="filter:alpha(opacity=' + e.settings.opacity * 100 + ");opacity:" + e.settings.opacity + ';"></div>');
            e.Lock.css({position: "fixed", top: 0, left: 0, width: "100%", height: "100%", "background-color": e.settings.lockBgColor, opacity: e.settings.opacity, "z-index": e.settings.zIndex});
            if (e.IE6) {
                e.Lock.css({display: "none"});
                e.createIframe(e.Lock)
            }
            i.append(e.Lock)
        }, createIframe: function(t) {
            t.innerHTML = '<iframe style="position:absolute;left:0;top:0;width:100%;height:100%;z-index:-1;border:0 none;filter:alpha(opacity=0)"></iframe>'
        }, createClose: function() {
            var e = this;
            e.closeBtn = t('<a class="popCloseBtn">关闭</a>');
            e.target.append(e.closeBtn)
        }, bindEvent: function() {
            var t = this;
            if (t.closeBtn) {
                t.closeBtn.bind("click", function() {
                    t.closePop()
                })
            }
            if (t.Lock && t.lockColse) {
                t.Lock.bind("click", function() {
                    t.closePop()
                })
            }
        }, closePop: function() {
            var t = this;
            clearTimeout(t.timer);
            if (t.Lock) {
                t.Lock.remove()
            }
            if (t.closeBtn) {
                t.closeBtn.remove()
            }
            t.target.removeClass("prevPopBox").hide();
            t.settings.colseCallback.call(t)
        }, closePrevPop: function() {
            i.find(".prevPopBox").hide().removeClass("prevPopBox")
        }};
    var l = {zIndex: 9999, middile: true, isLock: true, lockColse: false, lockBgColor: "#000", opacity: .5, time: null, isColseBtn: true, colseCallback: function() {
        }, beforeCallback: function() {
        }};
    t.fn.gPop = function(e) {
        e = t.extend({}, l, e);
        this.each(function() {
            new c(t(this), e)
        })
    }
})(jQuery);
gomeLib.fxCollect = {totality: null, getTotal: false, ajaxType: false, getCollect: function(t, i, e) {
        var l = this, a = loginData.loginId;
        l.addUrl = dynSite + contextPath + "/global/login/verifyAddToWishlist.jsp";
        l.getUrl = dynSite + contextPath + "/n/indexJson/getUserCollectProduct.jsp";
        l.addWish = function() {
            gomeLib.ajax({url: l.addUrl, jsonpName: "wishlist", d: t}, function(t) {
                if (i)
                    i(t)
            })
        };
        l.getWish = function() {
            if (!l.getTotal && !l.ajaxType) {
                l.ajaxType = true;
                gomeLib.ajax({url: l.getUrl, jsonpName: "fnwishlist"}, function(t) {
                    if (t) {
                        l.getTotal = true;
                        l.totality = t;
                        if (i)
                            i(l.totality)
                    }
                })
            } else {
                if (i)
                    i(l.totality)
            }
        };
        l.chkWish = function() {
            if (t) {
                if (e && e == "click") {
                    l.addWish()
                } else {
                    l.getWish()
                }
            } else {
                l.getWish()
            }
        };
        l.chkWish()
    }};
function merchantLive800CallBack(t, e) {
    var i = t.getAttribute("merchant") == 1;
    if (i) {
        if (e != 0 && e != 1) {
            $("#store_live800").addClass("off_live800")
        }
        if (e >= 0) {
            $("#store_live800_wrap").removeClass("off_live800")
        }
    }
    if ($(".live800Provider").find("span a").length > 0) {
        $(".live800Provider").parent().show()
    }
}
if (!LIM)
    var LIM = {};
var live800Icon_fn = [];
LIM.live800_IconInit = function() {
    if (live800Icon_fn && live800Icon_fn.length > 0) {
        live800Icon_fn[0]()
    }
};
(function() {
    var CONST = {live800Server: ["http://chat1.gome.com.cn/live800", "http://chat2.gome.com.cn/live800", "http://chat3.gome.com.cn/live800", "http://chat4.gome.com.cn/live800", "http://chat5.gome.com.cn/live800"], live800CssUrl: "live800_gome.css", live800IconUrl: ["live800_icon_s.png", "live800_icon_f.png"]};
    var SERVERCOUNT = CONST["live800Server"].length;
    window.Livebind = function(t, e, i, o) {
        if (window.attachEvent) {
            t.attachEvent("on" + e, i);
            if (o)
                i()
        } else {
            t.addEventListener(e, i, false)
        }
    };
    function $(t, e) {
        var i = (e || document.body).getElementsByTagName("*"), o = i.length, n = [];
        for (var r = 0; r < o; r++) {
            if (i[r].className.match(new RegExp("(^|\\s)" + t + "(\\s|$)"))) {
                n.push(i[r])
            }
        }
        return n
    }
    Sys = function() {
    };
    Sys.NS = document.layers ? true : false;
    Sys.IE = document.all ? true : false;
    Sys.DOM = document.getElementById ? true : false;
    if (Sys.IE)
        Sys.DOM = false;
    Sys.MAC = navigator.platform && navigator.platform.toUpperCase().indexOf("MAC") >= 0;
    if (Sys.NS)
        Sys.MAC = false;
    Sys.getObj = function(t) {
        if (document.getElementById)
            return document.getElementById(t);
        else if (document.all)
            return document.all(t)
    };
    if (!LIVEDOM)
        var LIVEDOM = {};
    LIVEDOM.domReady = function(f) {
        with (LIVEDOM) {
            if (domReady.done) {
                return f()
            }
            if (domReady.timer) {
                domReady.ready.push(f)
            } else {
                Livebind(window, "load", isDOMReady);
                domReady.ready = [f];
                var h = this;
                domReady.timer = setInterval(function() {
                    h.isDOMReady()
                }, 13)
            }
        }
    };
    LIVEDOM.isDOMReady = function() {
        with (LIVEDOM) {
            if (domReady.done) {
                return false
            }
            if (document && document.getElementsByTagName && document.getElementById && document.body) {
                clearInterval(domReady.timer);
                domReady.timer = null;
                for (var i = 0; i < domReady.ready.length; i++) {
                    domReady.ready[i]()
                }
                domReady.ready = null;
                domReady.done = true
            }
        }
    };
    function getRandomServer(t) {
        var e = t.length, i;
        if (e == 1) {
            i = 0
        } else {
            i = (new Date).getTime() % e
        }
        return t[i]
    }
    function getProtocol() {
        var t = document.location.protocol;
        t = t == "file:" ? "http:" : t;
        return t
    }
    function getchaturl(t, e) {
        var i = t.getAttribute("lim:company");
        if (e && e.length > 0) {
            i = e
        }
        var o = t.getAttribute("lim:page");
        var n = t.getAttribute("lim:shopId");
        var r = t.getAttribute("lim:shopname");
        var a = "", l = "", s = t;
        var c = CONST["live800Server"][getServer(i)] + "/chatClient/chatbox.jsp";
        var d = "info=" + window.loginData.infoValue || "_=_";
        a += "companyID=" + e;
        a += "&page=" + o;
        a += "&shopId=" + n;
        a += "&shopname=" + encodeURIComponent(r);
        if (a.indexOf("enterurl") == -1) {
            a += "&enterurl=" + encodeURIComponent(document.URL)
        }
        if (t.getAttribute("lim:productId") && t.getAttribute("lim:productId") != null) {
            a += "&productId=" + t.getAttribute("lim:productId")
        }
        if (t.getAttribute("lim:remark") && t.getAttribute("lim:remark") != null) {
            a += "&remark=" + urlEncode(t.getAttribute("lim:remark"))
        }
        a += "&" + d;
        if (getProtocol() == "https:") {
            c.replace("http:", "https:")
        }
        return c + "?" + a
    }
    function init(t, e, i) {
        var o = null;
        var n = "pointer";
        switch (e) {
            case-1:
                o = "disable";
                n = "default";
                break;
            case 0:
                o = "offline";
                n = "pointer";
                break;
            case 1:
                o = "online";
                n = "pointer";
                break;
            default:
                n = "default";
                o = null
        }
        if (typeof merchantLive800CallBack != "undefined") {
            merchantLive800CallBack(t, e)
        }
        var r = "%E5%95%86%E9%93%BA";
        var a = "%E5%AE%A2%E6%9C%8D%E6%9A%82%E6%97%B6%E4%B8%8D%E5%9C%A8%E7%BA%BF%EF%BC%8C%E5%9C%A8%E7%BA%BF%E6%9C%8D%E5%8A%A1%E6%97%B6%E9%97%B4%EF%BC%9A09%3A00--18%3A00";
        var l = t.getAttribute("lim:offLineTip");
        if (l != "") {
            a = l
        }
        var s = t.getAttribute("lim:shopName");
        if (s != "") {
            r = s
        }
        var c = new Array;
        c["statusClass"] = o;
        c["cursor"] = n;
        c["shopName"] = r;
        c["offLineTip"] = a;
        if (i) {
            c["companyId"] = i
        }
        var d = "steady";
        try {
            d = t.getAttribute("lim:type")
        } catch (f) {
            d = "steady"
        }
        if (d == "float") {
            new FloatIcon(t, c)
        } else {
            new SteadyIcon(t, c)
        }
    }
    function SteadyIcon(t, e) {
        this.elObj = t;
        this.preferences = e;
        this.image = CONST["live800IconUrl"][0];
        this.status = this.preferences["statusClass"];
        this.cursor = this.preferences["cursor"];
        this.shopName = this.preferences["shopName"];
        this.offLineTip = this.preferences["offLineTip"];
        this.companyId = this.preferences["companyId"];
        this.init()
    }
    SteadyIcon.prototype.init = function() {
        this.emptyIcon();
        if (this.status == "online") {
            this.Steady_generate();
            this.clickAction()
        } else if (this.status == "offline") {
            this.Steady_generate();
            this.offlineTipAction()
        } else {
        }
    };
    SteadyIcon.prototype.emptyIcon = function() {
        var t = this.elObj;
        t.innerHTML = ""
    };
    SteadyIcon.prototype.Steady_generate = function() {
        var t = this.elObj;
        var e = this.companyId;
        if (!e) {
            e = t.getAttribute("lim:company") || ""
        }
        var i = this.status;
        var o = true;
        if (i == "offline" && "3" != e) {
            o = false;
            this.cursor = "default"
        }
        var n = this.elObj.getAttribute("lim:innerHtm") || "";
        t.innerHTML = '<a href="javascript:;" class="' + this.status + 's" style="cursor:' + this.cursor + '">' + n + "</a>";
        Livebind(t, "click", function() {
            if (window.loginData.isTransient == true) {
                var i = window.location.href, n = staSite.replace("www", "login") + "/login?tableName=login&orginURI=" + i;
                window.location.href = n;
                return false
            } else {
                if (!o) {
                    return false
                }
                var r = getchaturl(t, e), a = "live800_" + t.getAttribute("lim:company");
                openwindow(a, r);
                return false
            }
        })
    };
    SteadyIcon.prototype.clickAction = function() {
        this.elObj.title = ""
    };
    SteadyIcon.prototype.offlineTipAction = function() {
        this.elObj.title = urlDecode(this.offLineTip)
    };
    function FloatIcon(t, e) {
        this.preferences = e;
        this.locationObj = t;
        this.company = this.preferences["companyId"] ? this.preferences["companyId"] : t.getAttribute("lim:company");
        this.shopName = this.preferences["shopName"];
        this.offLineTip = this.preferences["offLineTip"];
        this.inviteInnerHtml = null;
        this.changeTimerId = null;
        this.layerHtml = null;
        this.statusClass = this.preferences["statusClass"];
        this.image = CONST["live800IconUrl"][1];
        this.cursor = this.preferences["cursor"];
        this.toRight = t.getAttribute("lim:Position") == null ? "1" : t.getAttribute("lim:position");
        this.floatTop = parseInt(t.getAttribute("lim:FloatTop") == null ? "150" : t.getAttribute("lim:floatTop"));
        this.floatSide = parseInt(t.getAttribute("lim:FloatSide") == null ? "100" : t.getAttribute("lim:floatSide"));
        this.toBottom = false;
        this.init()
    }
    FloatIcon.prototype.init = function() {
        this.FloatIcon_generate();
        if (this.statusClass == "online") {
            this.clickAction()
        } else {
            this.offlineTipAction()
        }
    };
    FloatIcon.prototype.FloatIcon_generate = function() {
        var t = " left:" + this.floatSide + "px;";
        if (this.toRight == "1") {
            t = " right:" + this.floatSide + "px;"
        }
        this.layerHtml = '<div id="FloatIcon" style="z-index:8888;position:absolute;visibility:visible;' + t + "top:200px;height:auto;width:auto;\"><div style='position:relative;'>";
        this.inviteInnerHtml = '<a id="live800iconlink" target="_self" href="javascript:void(0)"' + ' class="' + this.statusClass + "f" + '" style="display:block;background-image:url(' + this.image + ");background-repeat:no-repeat;overflow:hidden;cursor:default" + ';border:none;"><div class="shopTitle"><div style="width:55px;height:18px;text-align:right;overflow:hidden;" title=' + urlDecode(this.shopName) + ">" + urlDecode(this.shopName) + "你好</div>" + '<div style="width:55px;">在线客服</div></div><img name="live800icon" id="live800icon" src="' + CONST["live800Server"] + "/SurferServer?cmd=111&companyID=" + this.company + '"  border="0" style="width:125px;height:20px;visibility:hidden;"/>' + '<div class="shopDESC" title="欢迎来到' + urlDecode(this.shopName) + '，有什么可以帮您?">欢迎来到' + urlDecode(this.shopName) + "，有什么可以帮您?</div>" + '<div id="live800FloatChatDiv" class="clickPath" style="cursor:' + this.cursor + '"></div></a>';
        this.layerHtml += this.inviteInnerHtml;
        this.layerHtml += "<div class='icon:close'><div></div>";
        this.locationObj.innerHTML = this.layerHtml;
        var e = this;
        this.changeTimerId = setInterval(function() {
            changeIcon(e)
        }, 200)
    };
    FloatIcon.prototype.clickAction = function() {
        var t = Sys.getObj("live800FloatChatDiv");
        if (t) {
            t.title = "";
            var e = new Array;
            e["company"] = this.company;
            e["page"] = this.locationObj.getAttribute("lim:page");
            e["shopId"] = this.locationObj.getAttribute("lim:shopId");
            e["productId"] = this.locationObj.getAttribute("lim:productId");
            e["remark"] = this.locationObj.getAttribute("lim:remark");
            e["params"] = "info=" + window.loginData.infoValue;
            var i = getFloatOpenUrl(e);
            var o = "live800_" + this.company;
            t.innerHTML = "<a href='" + i + "' target='" + o + "' style='display:block;overflow:hidden;border:none;'  onclick=\"openwindow('" + o + "');\"></a>"
        }
    };
    FloatIcon.prototype.offlineTipAction = function() {
        var t = Sys.getObj("live800FloatChatDiv");
        t.title = urlDecode(this.offLineTip)
    };
    function getFloatOpenUrl(t) {
        var e = t["company"];
        var i = t["page"];
        var o = t["shopId"];
        var n = t["shopname"];
        var r = CONST["live800Server"][getServer(e)] + "/chatClient/chatbox.jsp", a = t["params"] || "_=_", l = "", s = "";
        l += "companyID=" + e;
        l += "&page=" + i;
        l += "&shopId=" + o;
        l += "&shopname=" + encodeURIComponent(n);
        if (t["productId"] && t["productId"] != "") {
            l += "&productId=" + t["productId"]
        }
        if (t["remark"] && t["remark"] != "") {
            l += "&remark=" + urlEncode(t["remark"])
        }
        if (l.indexOf("enterurl") == -1) {
            l += "&enterurl=" + encodeURIComponent(document.URL)
        }
        l += "&" + a;
        if (getProtocol() == "https:") {
            r.replace("http:", "https:")
        }
        return r + "?" + l
    }
    FloatIcon.prototype.changeFloatIcon = function() {
        var obj = Sys.getObj("FloatIcon");
        var live800iconlink = Sys.getObj("live800iconlink");
        var live800icon = obj.getElementsByTagName("img")[0];
        var iconHeight = live800icon.height;
        var iconWidth = live800icon.width;
        var y;
        var x;
        if (this.toBottom) {
            if (document.body)
                y = document.body.clientHeight - iconHeight - this.floatTop;
            else
                y = innerHeight - iconHeight - this.floatTop
        } else
            y = this.floatTop;
        if (this.toRight == "1" && !!iconWidth) {
            if (document.body.clientWidth)
                x = document.body.clientWidth - iconWidth - this.floatSide + 16;
            else if (document.documentElement.clientWidth) {
                x = document.documentElement.clientWidth - iconWidth - this.floatSide
            } else
                x = innerWidth - iconWidth - this.floatSide
        } else
            x = this.floatSide;
        var obj = null;
        if (Sys.IE) {
            obj = document.all.FloatIcon.style
        } else if (Sys.NS) {
            obj = document.layers.FloatIcon
        } else if (Sys.DOM) {
            obj = Sys.getObj("FloatIcon").style
        }
        if (Sys.IE) {
            scrollPosY = 0;
            scrollPosX = 0;
            eval("try {" + 'if (typeof(document.documentElement) !=	"undefined") {' + "scrollPosY =	document.documentElement.scrollTop;" + "scrollPosX = document.documentElement.scrollLeft;" + "}" + "} catch	(e)	{}");
            scrollPosY = Math.max(document.body.scrollTop, scrollPosY);
            scrollPosX = Math.max(document.body.scrollLeft, scrollPosX);
            obj.left = scrollPosX + x + "px";
            obj.top = scrollPosY + y + "px"
        } else if (Sys.NS) {
            obj.left = pageXOffset + x;
            obj.top = pageYOffset + y
        } else if (Sys.DOM) {
            obj.left = pageXOffset + x + "px";
            obj.top = pageYOffset + y + "px"
        }
    };
    FloatIcon.prototype.clearTimer = function() {
        clearInterval(this.changeTimerId)
    };
    function changeIcon(t) {
        t.changeFloatIcon()
    }
    function getServer(t) {
        if (!t) {
            alert("parameters is invalidate!")
        }
        if (t == 3) {
            return parseInt(t) + 1 % SERVERCOUNT
        }
        return t % (SERVERCOUNT - 2)
    }
    function getStringValue(t) {
        if (t == null || "" == t) {
            return""
        }
        var e = t.split("&");
        var i = e.length;
        for (var o = 0; o < i; o++) {
            var n = e[o];
            var r = n.split("=");
            var a = r[0];
            if ("skillId" == a) {
                return r[1]
            }
        }
        return""
    }
    function sort(t) {
        var e = [];
        var i = t.length;
        for (var o = 0; o < SERVERCOUNT + 1; o++) {
            e[o] = []
        }
        var n;
        for (var o = 0; o < i; o++) {
            try {
                n = t[o].getAttribute("lim:company");
                if (n == "") {
                    continue
                }
                var r = "info=" + window.loginData.infoValue;
                var a = getStringValue(r);
                if (!a || a == "") {
                    a = "0"
                }
                if (/^\d+$/.test(n)) {
                    if ("3" == n) {
                        e[SERVERCOUNT].push({id: n, dom: t[o], skillId: a})
                    } else {
                        e[getServer(n)].push({id: n, dom: t[o], skillId: a})
                    }
                } else {
                    e[SERVERCOUNT - 1].push({id: n, dom: t[o], skillId: a})
                }
            } catch (l) {
                continue
            }
        }
        return e
    }
    function urlToParams(t) {
        try {
            var e = t.split("&"), i = [], o;
            for (var n = 0; n < e.length; n++) {
                o = e[n].split("=");
                i[o[0]] = o[1]
            }
            return i
        } catch (r) {
            E.report("请勿非法修改参数", "1206");
            return[]
        }
    }
    function urlEncode(t) {
        if (t == null || t == "") {
            return""
        }
        var e = "";
        function i(t) {
            return t.toString(16).toUpperCase()
        }
        for (var o = 0, n, r = t.length; o < r; o++) {
            n = t.charCodeAt(o);
            if (n < 16) {
                e += "%0" + n.toString(16).toUpperCase()
            } else if (n < 128) {
                if (n == 32) {
                    e += "+"
                } else if (n >= 48 && n <= 57 || n >= 65 && n <= 90 || n >= 97 && n <= 122) {
                    e += t.charAt(o)
                } else {
                    e += "%" + i(n)
                }
            } else if (n < 2048) {
                e += "%" + i(192 + (n >> 6));
                e += "%" + i(128 + n % 64)
            } else {
                e += "%" + i(224 + (n >> 12));
                e += "%" + i(128 + (n >> 6) % 64);
                e += "%" + i(128 + n % 64)
            }
        }
        return e
    }
    function urlDecode(t) {
        if (t == null || t == "") {
            return""
        }
        var e = "";
        function i(t) {
            return t.toString(16).toUpperCase()
        }
        for (var o = 0, n, r = t.length; o < r; ) {
            if (t.charAt(o) == "%") {
                n = t.charAt(o + 1);
                if (n.toLowerCase() == "e") {
                    e += String.fromCharCode((parseInt("0x" + t.substr(o + 1, 2)) - 224) * 4096 + (parseInt("0x" + t.substr(o + 4, 2)) - 128) * 64 + (parseInt("0x" + t.substr(o + 7, 2)) - 128));
                    o += 9
                } else if (n.toLowerCase() == "c" || n.toLowerCase() == "d") {
                    e += String.fromCharCode((parseInt("0x" + t.substr(o + 1, 2)) - 192) * 64 + parseInt("0x" + t.substr(o + 4, 2)) - 128);
                    o += 6
                } else {
                    e += String.fromCharCode(parseInt("0x" + t.substr(o + 1, 2)));
                    o += 3
                }
            } else {
                e += t.charAt(o).replace(/\+/, " ");
                o++
            }
        }
        return e
    }
    function getParams(t) {
        if (!t || t.length == 0) {
            return""
        }
        var e = [], i = t.length;
        var o = [];
        for (var n = 0; n < i; n++) {
            e.push(t[n].id);
            o.push(t[n].skillId)
        }
        return"companys=" + urlEncode(e.join(";")) + "&skillIds=" + urlEncode(o.join(";")) + "&t=" + (new Date).getTime()
    }
    function gysIcoInit(t, e) {
        if (t < 0) {
            return
        }
        var i = CONST["live800Server"][t] + "/mstatus.js?sid=" + t + "&" + getParams(e) + "&type=1";
        new live800Request(i, function() {
            var t = this.data.userlist;
            var e = this.data.sid;
            var i = 0;
            if (typeof live800Companys != "undefined") {
                var o = live800Companys;
                if (o) {
                    i = o.length
                }
                try {
                    var n = [];
                    var r = 0;
                    for (var a = 0; a < i; a++) {
                        var l = o[a][1];
                        var s = o[a][0];
                        var c = t[a].dom;
                        if (s && s != "-1") {
                            init(c, l, s)
                        } else {
                            n[r] = t[a];
                            r++
                        }
                    }
                    if (n && n.length > 0) {
                        e = e - 1;
                        gysIcoInit(e, n)
                    }
                } catch (d) {
                }
            }
        }, null, {sid: t, userlist: e})
    }
    function appendCss() {
    }
    function live800Request(t, e, i, o) {
        this.url = t;
        this.onload = e;
        this.onerror = i ? i : this.defaultError;
        this.data = o;
        this.init(t)
    }
    live800Request.prototype = {init: function(t) {
            this.script = document.createElement("script");
            this.script.setAttribute("type", "text/javascript");
            this.script.setAttribute("src", t);
            document.getElementsByTagName("head")[0].appendChild(this.script);
            var e = this;
            if (this.script) {
                if (document.all) {
                    var i = this.script;
                    this.script.onreadystatechange = function() {
                        var t = i.readyState;
                        if (t == "loaded" || t == "interactive" || t == "complete") {
                            e.onload.call(e)
                        }
                    }
                } else {
                    this.script.onload = function() {
                        e.onload.call(e)
                    }
                }
            } else {
                e.onerror.call(this)
            }
        }, defaultError: function() {
            alert("create script node fail!")
        }};
    function onInit() {
        var t = $("live800");
        var e = sort(t), i = e.length;
        if (i > 0) {
            appendCss();
            for (var o = 0; o < i; o++) {
                if (e[o] && e[o].length > 0) {
                    if (o == SERVERCOUNT - 1) {
                        gysIcoInit(2, e[o])
                    } else if (o == SERVERCOUNT) {
                        var n = e[o].length;
                        for (var r = 0; r < n; r++) {
                            init(e[o][r].dom, 1)
                        }
                    } else {
                        var a = CONST["live800Server"][o] + "/mstatus.js?sid=" + o + "&" + getParams(e[o]);
                        new live800Request(a, function() {
                            var t = this.data.userlist;
                            var e = this.data.sid;
                            var i = 0;
                            if (typeof live800Status != "undefined") {
                                var o = live800Status ? live800Status[e] : [];
                                if (o) {
                                    i = o.length
                                }
                                try {
                                    for (var n = 0; n < i; n++) {
                                        init(t[n].dom, o[n])
                                    }
                                } catch (r) {
                                }
                            }
                        }, null, {sid: o, userlist: e[o]})
                    }
                }
            }
        }
    }
    LIVEDOM.domReady(function() {
        onInit();
        live800Icon_fn.push(onInit)
    })
})();
function openwindow(t, e) {
    var i = "toolbar=0,scrollbars=1,location=0,menubar=0,resizable=1,width=1240,height=700";
    try {
        var o = window.open(e || "", t, i);
        o.focus();
        o.opener = window
    } catch (n) {
        if (window.console)
            window.console.log("弹出在线客服窗口失败。")
    }
}